LSST Applications 28.0.2,g0fba68d861+5b923b673a,g1fd858c14a+7a7b9dd5ed,g2c84ff76c0+5548bfee71,g30358e5240+f0e04ebe90,g35bb328faa+fcb1d3bbc8,g436fd98eb5+bdc6fcdd04,g4af146b050+742274f7cd,g4d2262a081+3efd3f8190,g4e0f332c67+cb09b8a5b6,g53246c7159+fcb1d3bbc8,g5a012ec0e7+477f9c599b,g5edb6fd927+826dfcb47f,g60b5630c4e+bdc6fcdd04,g67b6fd64d1+2218407a0c,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g87b7deb4dc+f9ac2ab1bd,g8852436030+ebf28f0d95,g89139ef638+2218407a0c,g9125e01d80+fcb1d3bbc8,g989de1cb63+2218407a0c,g9f33ca652e+42fb53f4c8,g9f7030ddb1+11b9b6f027,ga2b97cdc51+bdc6fcdd04,gab72ac2889+bdc6fcdd04,gabe3b4be73+1e0a283bba,gabf8522325+3210f02652,gb1101e3267+9c79701da9,gb58c049af0+f03b321e39,gb89ab40317+2218407a0c,gcf25f946ba+ebf28f0d95,gd6cbbdb0b4+e8f9c9c900,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+a08f294619,ge278dab8ac+3ef3db156b,ge410e46f29+2218407a0c,gf67bdafdda+2218407a0c
LSST Data Management Base Package
|
Base class for all records. More...
#include <BaseRecord.h>
Classes | |
class | ConstructionToken |
Public Types | |
using | Table = BaseTable |
The associated table class. | |
using | ColumnView = BaseColumnView |
The associated ColumnView class. | |
using | Catalog = CatalogT<BaseRecord> |
Template of CatalogT used to hold records of this type. | |
using | ConstCatalog = CatalogT<const BaseRecord> |
Template of CatalogT used to hold const records of this type. | |
Public Member Functions | |
BaseRecord (ConstructionToken const &, detail::RecordData &&data) | |
Construct a record with uninitialized data. | |
BaseRecord (const BaseRecord &)=delete | |
BaseRecord & | operator= (const BaseRecord &)=delete |
BaseRecord (BaseRecord &&)=delete | |
BaseRecord & | operator= (BaseRecord &&)=delete |
Schema | getSchema () const |
Return the Schema that holds this record's fields and keys. | |
std::shared_ptr< BaseTable const > | getTable () const |
Return the table this record is associated with. | |
template<typename T> | |
Field< T >::Element * | getElement (Key< T > const &key) |
Return a pointer to the underlying elements of a field (non-const). | |
template<typename T> | |
Field< T >::Element const * | getElement (Key< T > const &key) const |
Return a pointer to the underlying elements of a field (const). | |
template<typename T> | |
Field< T >::Reference | operator[] (Key< T > const &key) |
Return a reference (or reference-like type) to the field's value. | |
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. | |
template<typename T> | |
Field< T >::Value | get (Key< T > const &key) const |
Return the value of a field for the given key. | |
template<typename T, typename U> | |
void | set (Key< T > const &key, U const &value) |
Set value of a field for the given key. | |
template<typename T> | |
T | get (OutputFunctorKey< T > const &key) const |
Compute a calculated or aggregate field. | |
template<typename T, typename U> | |
void | set (InputFunctorKey< T > const &key, U const &value) |
Set a calculated or aggregate field. | |
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. | |
void | assign (BaseRecord const &other, SchemaMapper const &mapper) |
Copy field values from other to this, using a mapper. | |
ndarray::Manager::Ptr | getManager () const |
virtual | ~BaseRecord () |
Protected Member Functions | |
virtual void | _assign (BaseRecord const &other) |
Called by assign() after transferring fields to allow subclass data members to be copied. | |
virtual void | _stream (std::ostream &os) const |
Called by operator<<. | |
Friends | |
class | BaseTable |
class | BaseColumnView |
std::ostream & | operator<< (std::ostream &os, BaseRecord const &record) |
Write the record's content out, one field on each line. | |
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 31 of file BaseRecord.h.
Template of CatalogT used to hold records of this type.
Definition at line 74 of file BaseRecord.h.
The associated ColumnView class.
Definition at line 71 of file BaseRecord.h.
using lsst::afw::table::BaseRecord::ConstCatalog = CatalogT<const BaseRecord> |
Template of CatalogT used to hold const records of this type.
Definition at line 77 of file BaseRecord.h.
The associated table class.
Definition at line 68 of file BaseRecord.h.
lsst::afw::table::BaseRecord::BaseRecord | ( | ConstructionToken const & | , |
detail::RecordData && | data ) |
Construct a record with uninitialized data.
Access to this constructor is restricted to BaseTable and BaseRecord subclasses via the ConstructionToken argument, which can only be constructed by BaseTable. This constructor is public so it can still be called by std::make_shared code with access to ConstructionToken.
Definition at line 143 of file BaseRecord.cc.
|
delete |
|
delete |
|
inlinevirtual |
Definition at line 202 of file BaseRecord.h.
|
inlineprotectedvirtual |
Called by assign() after transferring fields to allow subclass data members to be copied.
Reimplemented in lsst::afw::table::ExposureRecord, and lsst::afw::table::SourceRecord.
Definition at line 209 of file BaseRecord.h.
|
protectedvirtual |
Called by operator<<.
Overrides should call the base class implementation and append additional fields on new lines, with the syntax "%(name)s: %(value)s".
Definition at line 152 of file BaseRecord.cc.
void lsst::afw::table::BaseRecord::assign | ( | BaseRecord const & | other | ) |
Copy all field values from other to this, requiring that they have equal schemas.
Definition at line 122 of file BaseRecord.cc.
void lsst::afw::table::BaseRecord::assign | ( | BaseRecord const & | other, |
SchemaMapper const & | mapper ) |
Copy field values from other to this, using a mapper.
Definition at line 130 of file BaseRecord.cc.
|
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 151 of file BaseRecord.h.
|
inline |
Compute a calculated or aggregate field.
Definition at line 172 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 93 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 111 of file BaseRecord.h.
|
inline |
Definition at line 200 of file BaseRecord.h.
|
inline |
Return the Schema that holds this record's fields and keys.
Definition at line 80 of file BaseRecord.h.
|
inline |
Return the table this record is associated with.
Definition at line 83 of file BaseRecord.h.
|
delete |
|
delete |
|
inline |
Definition at line 190 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 SpherePoint) do not support reference access.
No checking is done to ensure the Key belongs to the correct schema.
Definition at line 129 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 SpherePoint) do not support reference access.
No checking is done to ensure the Key belongs to the correct schema.
Definition at line 141 of file BaseRecord.h.
|
inline |
Definition at line 185 of file BaseRecord.h.
|
inline |
Set a calculated or aggregate field.
Definition at line 180 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 164 of file BaseRecord.h.
|
friend |
Definition at line 218 of file BaseRecord.h.
|
friend |
Definition at line 217 of file BaseRecord.h.
|
friend |
Write the record's content out, one field on each line.
Definition at line 158 of file BaseRecord.cc.