LSSTApplications  11.0-24-g0a022a1,14.0+64,15.0,15.0+1,15.0-1-g14e9bfd,15.0-1-g1eca518,15.0-1-g499c38d,15.0-1-g60afb23,15.0-1-g6668b0b,15.0-1-g788a293,15.0-1-g82223af,15.0-1-ga91101e,15.0-1-gae1598d,15.0-1-gc45031d,15.0-1-gd076f1f,15.0-1-gf4f1c34,15.0-1-gfe1617d,15.0-16-g953e39cab,15.0-2-g2010ef9,15.0-2-g33d94b3,15.0-2-g5218728,15.0-2-g947dc0d,15.0-3-g9103c06,15.0-3-ga03b4ca,15.0-3-ga659d1f3,15.0-3-ga695220+2,15.0-3-gaec6799,15.0-3-gb7a597c,15.0-3-gd5b9ff95,15.0-4-g0478fed+2,15.0-4-g45f767a,15.0-4-gff20472+2,15.0-6-ge2d9597
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::geom::IdentityXYTransform Class Reference

A trivial XYTransform satisfying f(x)=x. More...

#include <XYTransform.h>

Inheritance diagram for lsst::afw::geom::IdentityXYTransform:
lsst::afw::geom::XYTransform lsst::daf::base::Citizen

Public Types

typedef afw::geom::Point2D Point2D
 
typedef afw::geom::AffineTransform AffineTransform
 
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback) (const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 IdentityXYTransform ()
 
 IdentityXYTransform (IdentityXYTransform const &)
 
 IdentityXYTransform (IdentityXYTransform &&)
 
IdentityXYTransformoperator= (IdentityXYTransform const &)
 
IdentityXYTransformoperator= (IdentityXYTransform &&)
 
 ~IdentityXYTransform ()
 
virtual std::shared_ptr< XYTransformclone () const
 returns a deep copy More...
 
virtual Point2D forwardTransform (Point2D const &point) const
 virtuals for forward and reverse transforms More...
 
virtual Point2D reverseTransform (Point2D const &point) const
 
virtual AffineTransform linearizeForwardTransform (Point2D const &point) const
 linearized forward and reversed transforms More...
 
virtual AffineTransform linearizeReverseTransform (Point2D const &point) const
 default implementation; subclass may override More...
 
virtual std::shared_ptr< XYTransforminvert () const
 returns a "deep inverse" in this sense that the forward+inverse transforms do not share state default implementation; subclass may override More...
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Static Public Member Functions

static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
Census

Provide a list of current Citizens

static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector< const Citizen * > * census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
callbackIDs

Set callback Ids.

The old Id is returned

static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
callbacks

Set the New/Delete callback functions; in each case the previously installed callback is returned.

These callback functions return a value which is Added to the previously registered id.

The default callback functions are called default{New,Delete}Callback; you may want to set a break point in these callbacks from your favourite debugger

static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 

Detailed Description

A trivial XYTransform satisfying f(x)=x.

Deprecated:
Deprecated in 14.0. Will be removed in 15.0; it is superseded by geom::makeIdentityTransform.

Definition at line 104 of file XYTransform.h.

Member Typedef Documentation

◆ AffineTransform

Definition at line 52 of file XYTransform.h.

◆ memCallback

typedef memId(* lsst::daf::base::Citizen::memCallback) (const Citizen *ptr)
inherited

Definition at line 59 of file Citizen.h.

◆ memId

typedef unsigned long lsst::daf::base::Citizen::memId
inherited

Type of the block's ID.

Definition at line 56 of file Citizen.h.

◆ memNewCallback

typedef memId(* lsst::daf::base::Citizen::memNewCallback) (const memId cid)
inherited

A function used to register a callback.

Definition at line 58 of file Citizen.h.

◆ Point2D

Definition at line 51 of file XYTransform.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
magicSentinel 

Definition at line 86 of file Citizen.h.

Constructor & Destructor Documentation

◆ IdentityXYTransform() [1/3]

lsst::afw::geom::IdentityXYTransform::IdentityXYTransform ( )

Definition at line 32 of file IdentityXYTransform.cc.

◆ IdentityXYTransform() [2/3]

lsst::afw::geom::IdentityXYTransform::IdentityXYTransform ( IdentityXYTransform const &  )
default

◆ IdentityXYTransform() [3/3]

lsst::afw::geom::IdentityXYTransform::IdentityXYTransform ( IdentityXYTransform &&  )
default

◆ ~IdentityXYTransform()

lsst::afw::geom::IdentityXYTransform::~IdentityXYTransform ( )
default

Member Function Documentation

◆ census() [1/3]

int lsst::daf::base::Citizen::census ( int  ,
memId  startingMemId = 0 
)
staticinherited

How many active Citizens are there?

Parameters
startingMemIdDon't print Citizens with lower IDs

Definition at line 261 of file Citizen.cc.

264  {
265  if (startingMemId == 0) { // easy
266  ReadGuard guard(citizenLock);
267  return _activeCitizens.size();
268  }
269 
270  int n = 0;
271  ReadGuard guard(citizenLock);
272  for (table::iterator cur = _activeCitizens.begin();
273  cur != _activeCitizens.end(); cur++) {
274  if (cur->first->_CitizenId >= startingMemId) {
275  n++;
276  }
277  }
278 
279  return n;
280 }
T end(T... args)
T size(T... args)
T begin(T... args)

◆ census() [2/3]

void lsst::daf::base::Citizen::census ( std::ostream stream,
memId  startingMemId = 0 
)
staticinherited

Print a list of all active Citizens to stream, sorted by ID.

Parameters
streamstream to print to
startingMemIdDon't print Citizens with lower IDs

Definition at line 284 of file Citizen.cc.

287  {
288  ReadGuard guard(citizenLock);
289 
291 
292  for (std::vector<Citizen const *>::const_iterator citizen = leaks->begin(), end = leaks->end();
293  citizen != end; ++citizen) {
294  if ((*citizen)->getId() >= startingMemId) {
295  stream << (*citizen)->repr() << "\n";
296  }
297  }
298 }
STL class.
STL class.
T begin(T... args)
int end
static const std::vector< const Citizen * > * census()
Return a (newly allocated) std::vector of active Citizens sorted by ID.
Definition: Citizen.cc:316

◆ census() [3/3]

std::vector< dafBase::Citizen const * > const * lsst::daf::base::Citizen::census ( )
staticinherited

Return a (newly allocated) std::vector of active Citizens sorted by ID.

You are responsible for deleting it; or you can say std::unique_ptr<std::vector<Citizen const*> const> leaks(Citizen::census()); and not bother (that becomes std::unique_ptr in C++11)

Definition at line 316 of file Citizen.cc.

316  {
319  ReadGuard guard(citizenLock);
320  vec->reserve(_activeCitizens.size());
321 
322  for (table::iterator cur = _activeCitizens.begin();
323  cur != _activeCitizens.end(); cur++) {
324  vec->push_back(dynamic_cast<Citizen const*>(cur->first));
325  }
326 
327  std::sort(vec->begin(), vec->end(), cmpId);
328 
329  return vec;
330 }
T end(T... args)
T push_back(T... args)
T size(T... args)
STL class.
T begin(T... args)
T sort(T... args)
T reserve(T... args)

◆ clone()

std::shared_ptr< XYTransform > lsst::afw::geom::IdentityXYTransform::clone ( ) const
virtual

returns a deep copy

Implements lsst::afw::geom::XYTransform.

Definition at line 40 of file IdentityXYTransform.cc.

40  {
41  return std::make_shared<IdentityXYTransform>();
42 }

◆ forwardTransform()

Point2D lsst::afw::geom::IdentityXYTransform::forwardTransform ( Point2D const &  point) const
virtual

virtuals for forward and reverse transforms

These routines are responsible for throwing exceptions if the 'point' arg is outside the domain of the transform.

Implements lsst::afw::geom::XYTransform.

Definition at line 44 of file IdentityXYTransform.cc.

44 { return point; }

◆ getId()

dafBase::Citizen::memId lsst::daf::base::Citizen::getId ( ) const
inherited

Return the Citizen's ID.

Definition at line 218 of file Citizen.cc.

218  {
219  return _CitizenId;
220 }

◆ getNextMemId()

dafBase::Citizen::memId lsst::daf::base::Citizen::getNextMemId ( )
staticinherited

Return the memId of the next object to be allocated.

Definition at line 223 of file Citizen.cc.

223  {
224  return _nextMemId();
225 }

◆ hasBeenCorrupted()

bool lsst::daf::base::Citizen::hasBeenCorrupted ( )
staticinherited

Check all allocated blocks for corruption.

Definition at line 347 of file Citizen.cc.

347  {
348  ReadGuard guard(citizenLock);
349  for (table::iterator cur = _activeCitizens.begin();
350  cur != _activeCitizens.end(); cur++) {
351  if (cur->first->_hasBeenCorrupted()) {
352  return true;
353  }
354  }
355  for (table::iterator cur = _persistentCitizens.begin();
356  cur != _persistentCitizens.end(); cur++) {
357  if (cur->first->_hasBeenCorrupted()) {
358  return true;
359  }
360  }
361 
362  return false;
363 }
T end(T... args)
T begin(T... args)

◆ init()

int lsst::daf::base::Citizen::init ( )
staticinherited

Called once when the memory system is being initialised.

Definition at line 208 of file Citizen.cc.

208  {
209  volatile int dummy = 1;
210  return dummy;
211 }

◆ invert()

std::shared_ptr< XYTransform > lsst::afw::geom::XYTransform::invert ( ) const
virtualinherited

returns a "deep inverse" in this sense that the forward+inverse transforms do not share state default implementation; subclass may override

Reimplemented in lsst::afw::geom::RadialXYTransform, and lsst::afw::geom::InvertedXYTransform.

Definition at line 55 of file XYTransform.cc.

55  {
56  return std::make_shared<InvertedXYTransform>(this->clone());
57 }
virtual std::shared_ptr< XYTransform > clone() const =0
returns a deep copy

◆ linearizeForwardTransform()

AffineTransform lsst::afw::geom::IdentityXYTransform::linearizeForwardTransform ( Point2D const &  point) const
virtual

linearized forward and reversed transforms

Deprecated:
Deprecated in 14.0. Will be removed in 15.0; it is superseded by geom::linearizeTransform.

These are virtual but not pure virtual; there is a default implementation which calls forwardTransform() or reverseTransform() and takes finite differences with step size equal to one.

The following should always be satisfied for an arbitrary Point2D p (and analogously for the reverse transform) this->forwardTransform(p) == this->linearizeForwardTransform(p)(p);default implementation; subclass may override

Reimplemented from lsst::afw::geom::XYTransform.

Definition at line 48 of file IdentityXYTransform.cc.

48  {
49  // note: AffineTransform constructor called with no arguments gives the identity transform
50  return AffineTransform();
51 }
afw::geom::AffineTransform AffineTransform
Definition: XYTransform.h:52

◆ linearizeReverseTransform()

AffineTransform lsst::afw::geom::IdentityXYTransform::linearizeReverseTransform ( Point2D const &  point) const
virtual

default implementation; subclass may override

Reimplemented from lsst::afw::geom::XYTransform.

Definition at line 53 of file IdentityXYTransform.cc.

53  {
54  // note: AffineTransform constructor called with no arguments gives the identity transform
55  return AffineTransform();
56 }
afw::geom::AffineTransform AffineTransform
Definition: XYTransform.h:52

◆ markPersistent()

void lsst::daf::base::Citizen::markPersistent ( void  )
inherited

Mark a Citizen as persistent and not destroyed until process end.

Definition at line 248 of file Citizen.cc.

248  {
249  WriteGuard guard(citizenLock);
250  _persistentCitizens[this] = _activeCitizens[this];
251  _activeCitizens.erase(this);
252 }
T erase(T... args)

◆ operator=() [1/2]

IdentityXYTransform & lsst::afw::geom::IdentityXYTransform::operator= ( IdentityXYTransform const &  )
default

◆ operator=() [2/2]

IdentityXYTransform & lsst::afw::geom::IdentityXYTransform::operator= ( IdentityXYTransform &&  )
default

◆ repr()

std::string lsst::daf::base::Citizen::repr ( ) const
inherited

Return a string representation of a Citizen.

Definition at line 239 of file Citizen.cc.

239  {
240  return boost::str(boost::format("%d: %08x %s")
241  % _CitizenId
242  % this
243  % lsst::utils::demangleType(_typeName)
244  );
245 }
std::string demangleType(std::string const _typeName)
Definition: Demangle.cc:113
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134

◆ reverseTransform()

Point2D lsst::afw::geom::IdentityXYTransform::reverseTransform ( Point2D const &  point) const
virtual

Implements lsst::afw::geom::XYTransform.

Definition at line 46 of file IdentityXYTransform.cc.

46 { return point; }

◆ setCorruptionCallback()

dafBase::Citizen::memCallback lsst::daf::base::Citizen::setCorruptionCallback ( Citizen::memCallback  func)
staticinherited

Set the CorruptionCallback function.

Parameters
funcfunction be called when block is found to be corrupted

Definition at line 426 of file Citizen.cc.

428  {
429  Citizen::memCallback old = _corruptionCallback;
430  _corruptionCallback = func;
431 
432  return old;
433 }
memId(* memCallback)(const Citizen *ptr)
Definition: Citizen.h:59

◆ setDeleteCallback()

dafBase::Citizen::memCallback lsst::daf::base::Citizen::setDeleteCallback ( Citizen::memCallback  func)
staticinherited

Set the DeleteCallback function.

Parameters
funcfunction be called when desired block is deleted

Definition at line 416 of file Citizen.cc.

418  {
419  Citizen::memCallback old = _deleteCallback;
420  _deleteCallback = func;
421 
422  return old;
423 }
memId(* memCallback)(const Citizen *ptr)
Definition: Citizen.h:59

◆ setDeleteCallbackId()

dafBase::Citizen::memId lsst::daf::base::Citizen::setDeleteCallbackId ( Citizen::memId  id)
staticinherited

Call the current DeleteCallback when block is deleted.

Parameters
idDesired ID

Definition at line 381 of file Citizen.cc.

383  {
384  WriteGuard guard(citizenLock);
385  Citizen::memId oldId = _deleteId;
386  _deleteId = id;
387 
388  return oldId;
389 }
unsigned long memId
Type of the block&#39;s ID.
Definition: Citizen.h:56
int id
Definition: CR.cc:155

◆ setNewCallback()

dafBase::Citizen::memNewCallback lsst::daf::base::Citizen::setNewCallback ( Citizen::memNewCallback  func)
staticinherited

Set the NewCallback function.

Parameters
funcThe new function to be called when a designated block is allocated

Definition at line 406 of file Citizen.cc.

408  {
409  Citizen::memNewCallback old = _newCallback;
410  _newCallback = func;
411 
412  return old;
413 }
memId(* memNewCallback)(const memId cid)
A function used to register a callback.
Definition: Citizen.h:58

◆ setNewCallbackId()

dafBase::Citizen::memId lsst::daf::base::Citizen::setNewCallbackId ( Citizen::memId  id)
staticinherited

Call the NewCallback when block is allocated.

Parameters
idDesired ID

Definition at line 370 of file Citizen.cc.

372  {
373  WriteGuard guard(citizenLock);
374  Citizen::memId oldId = _newId;
375  _newId = id;
376 
377  return oldId;
378 }
unsigned long memId
Type of the block&#39;s ID.
Definition: Citizen.h:56
int id
Definition: CR.cc:155

The documentation for this class was generated from the following files: