LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Base class for all records. More...
#include <BaseRecord.h>
Public Types | |
typedef BaseTable | Table |
The associated table class. More... | |
typedef BaseColumnView | ColumnView |
The associated ColumnView class. More... | |
typedef CatalogT< BaseRecord > | Catalog |
Template of CatalogT used to hold records of this type. More... | |
typedef CatalogT< BaseRecord const > | ConstCatalog |
Template of CatalogT used to hold const records of this type. More... | |
Public Types inherited from lsst::daf::base::Citizen | |
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 | |
Schema | getSchema () const |
Return the Schema that holds this record's fields and keys. More... | |
boost::shared_ptr< BaseTable const > | getTable () const |
Return the table this record is associated with. More... | |
template<typename T > | |
Field< T >::Element * | getElement (Key< T > const &key) |
Return a pointer to the underlying elements of a field (non-const). More... | |
template<typename T > | |
Field< T >::Element const * | getElement (Key< T > const &key) const |
Return a pointer to the underlying elements of a field (const). More... | |
template<typename T > | |
Field< T >::Reference | operator[] (Key< T > const &key) |
Return a reference (or reference-like type) to the field's value. More... | |
template<typename T > | |
Field< T >::ConstReference | operator[] (Key< T > const &key) const |
Return a const reference (or const-reference-like type) to the field's value. More... | |
template<typename T > | |
Field< T >::Value | get (Key< T > const &key) const |
Return the value of a field for the given key. More... | |
template<typename T , typename U > | |
void | set (Key< T > const &key, U const &value) |
Set value of a field for the given key. More... | |
template<typename T > | |
T | get (OutputFunctorKey< T > const &key) const |
Compute a calculated or aggregate field. More... | |
template<typename T , typename U > | |
void | set (InputFunctorKey< T > const &key, U const &value) |
Set a calculated or aggregate field. More... | |
template<typename Ref > | |
Ref | operator[] (ReferenceFunctorKey< Ref > const &key) |
template<typename ConstRef > | |
ConstRef | operator[] (ConstReferenceFunctorKey< ConstRef > const &key) const |
void | assign (BaseRecord const &other) |
Copy all field values from other to this, requiring that they have equal schemas. More... | |
void | assign (BaseRecord const &other, SchemaMapper const &mapper) |
Copy field values from other to this, using a mapper. More... | |
ndarray::Manager::Ptr | getManager () const |
virtual | ~BaseRecord () |
Public Member Functions inherited from lsst::daf::base::Citizen | |
Citizen (const std::type_info &) | |
Citizen (Citizen const &) | |
~Citizen () | |
Citizen & | operator= (Citizen const &) |
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... | |
Protected Member Functions | |
virtual void | _assign (BaseRecord const &other) |
Called by assign() after transferring fields to allow subclass data members to be copied. More... | |
BaseRecord (boost::shared_ptr< BaseTable > const &table) | |
Construct a record with uninitialized data. More... | |
Private Attributes | |
void * | _data |
boost::shared_ptr< BaseTable > | _table |
ndarray::Manager::Ptr | _manager |
Friends | |
class | BaseTable |
class | BaseColumnView |
Additional Inherited Members | |
Static Public Member Functions inherited from lsst::daf::base::Citizen | |
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... | |
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... | |
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... | |
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... | |
Base class for all records.
BaseRecord is a polymorphic base class that provides the core record interface: access to fields and links back to the table it is associated with. Field access is provided by the templated get, set, and operator[] member functions. As templates they are nonvirtual and cannot be overridden by subclasses. The implementations for these accessors is in the FieldBase template specializations.
Each subclass of BaseRecord should be paired with a subclass of BaseTable. All record creation goes through a table, as the table allocates the memory used to store a record's fields and holds the Schema instance that defines those fields.
Records are noncopyable, and are hence usually passed by shared_ptr or [const-]reference.
Definition at line 27 of file BaseRecord.h.
Template of CatalogT used to hold records of this type.
Definition at line 42 of file BaseRecord.h.
The associated ColumnView class.
Definition at line 39 of file BaseRecord.h.
typedef CatalogT<BaseRecord const> lsst::afw::table::BaseRecord::ConstCatalog |
Template of CatalogT used to hold const records of this type.
Definition at line 45 of file BaseRecord.h.
The associated table class.
Definition at line 36 of file BaseRecord.h.
|
inlinevirtual |
Definition at line 178 of file BaseRecord.h.
|
inlineprotected |
Construct a record with uninitialized data.
Definition at line 186 of file BaseRecord.h.
|
inlineprotectedvirtual |
Called by assign() after transferring fields to allow subclass data members to be copied.
Reimplemented in lsst::afw::table::SourceRecord, and lsst::afw::table::ExposureRecord.
Definition at line 183 of file BaseRecord.h.
void lsst::afw::table::BaseRecord::assign | ( | BaseRecord const & | other | ) |
Copy all field values from other to this, requiring that they have equal schemas.
void lsst::afw::table::BaseRecord::assign | ( | BaseRecord const & | other, |
SchemaMapper const & | mapper | ||
) |
Copy field values from other to this, using a mapper.
|
inline |
Return the value of a field for the given key.
No checking is done to ensure the Key belongs to the correct schema.
Definition at line 123 of file BaseRecord.h.
|
inline |
Compute a calculated or aggregate field.
Definition at line 146 of file BaseRecord.h.
|
inline |
Return a pointer to the underlying elements of a field (non-const).
This low-level access is intended mostly for use with serialization; users should generally prefer the safer get(), set() and operator[] member functions.
Definition at line 61 of file BaseRecord.h.
|
inline |
Return a pointer to the underlying elements of a field (const).
This low-level access is intended mostly for use with serialization; users should generally prefer the safer get(), set() and operator[] member functions.
Definition at line 81 of file BaseRecord.h.
|
inline |
Definition at line 176 of file BaseRecord.h.
|
inline |
Return the Schema that holds this record's fields and keys.
Definition at line 48 of file BaseRecord.h.
|
inline |
Return the table this record is associated with.
Definition at line 51 of file BaseRecord.h.
|
inline |
Return a reference (or reference-like type) to the field's value.
Some field types (Point, Moments, Flag, Covariance, and Coord) do not support reference access.
No checking is done to ensure the Key belongs to the correct schema.
Definition at line 101 of file BaseRecord.h.
|
inline |
Return a const reference (or const-reference-like type) to the field's value.
Some field types (Point, Moments, Flag, Covariance, and Coord) do not support reference access.
No checking is done to ensure the Key belongs to the correct schema.
Definition at line 113 of file BaseRecord.h.
|
inline |
Definition at line 159 of file BaseRecord.h.
|
inline |
Definition at line 164 of file BaseRecord.h.
|
inline |
Set value of a field for the given key.
This method has an additional template parameter because some fields accept and convert different types to the stored field type.
No checking is done to ensure the Key belongs to the correct schema.
Definition at line 136 of file BaseRecord.h.
|
inline |
Set a calculated or aggregate field.
Definition at line 154 of file BaseRecord.h.
|
friend |
Definition at line 193 of file BaseRecord.h.
|
friend |
Definition at line 192 of file BaseRecord.h.
|
private |
Definition at line 196 of file BaseRecord.h.
|
private |
Definition at line 198 of file BaseRecord.h.
|
private |
Definition at line 197 of file BaseRecord.h.