lsst.afw  13.0-73-gb2a4e38
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
lsst::afw::table::BaseRecord Class Reference

Base class for all records. More...

#include <BaseRecord.h>

Inheritance diagram for lsst::afw::table::BaseRecord:
lsst::afw::detection::PeakRecord lsst::afw::table::AmpInfoRecord lsst::afw::table::ExposureRecord lsst::afw::table::SimpleRecord lsst::afw::table::SourceRecord

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 Member Functions

 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. More...
 
std::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 ()
 

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 (std::shared_ptr< BaseTable > const &table)
 Construct a record with uninitialized data. More...
 

Friends

class BaseTable
 
class BaseColumnView
 

Detailed Description

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 29 of file BaseRecord.h.

Member Typedef Documentation

Template of CatalogT used to hold records of this type.

Definition at line 46 of file BaseRecord.h.

The associated ColumnView class.

Definition at line 43 of file BaseRecord.h.

Template of CatalogT used to hold const records of this type.

Definition at line 49 of file BaseRecord.h.

The associated table class.

Definition at line 40 of file BaseRecord.h.

Constructor & Destructor Documentation

lsst::afw::table::BaseRecord::BaseRecord ( const BaseRecord &  )
delete
lsst::afw::table::BaseRecord::BaseRecord ( BaseRecord &&  )
delete
virtual lsst::afw::table::BaseRecord::~BaseRecord ( )
inlinevirtual

Definition at line 174 of file BaseRecord.h.

lsst::afw::table::BaseRecord::BaseRecord ( std::shared_ptr< BaseTable > const &  table)
inlineprotected

Construct a record with uninitialized data.

Definition at line 181 of file BaseRecord.h.

Member Function Documentation

virtual void lsst::afw::table::BaseRecord::_assign ( BaseRecord const &  other)
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 178 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.

template<typename T >
Field<T>::Value lsst::afw::table::BaseRecord::get ( Key< T > const &  key) const
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.

template<typename T >
T lsst::afw::table::BaseRecord::get ( OutputFunctorKey< T > const &  key) const
inline

Compute a calculated or aggregate field.

Definition at line 144 of file BaseRecord.h.

template<typename T >
Field<T>::Element* lsst::afw::table::BaseRecord::getElement ( Key< T > const &  key)
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 65 of file BaseRecord.h.

template<typename T >
Field<T>::Element const* lsst::afw::table::BaseRecord::getElement ( Key< T > const &  key) const
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 83 of file BaseRecord.h.

ndarray::Manager::Ptr lsst::afw::table::BaseRecord::getManager ( ) const
inline

Definition at line 172 of file BaseRecord.h.

Schema lsst::afw::table::BaseRecord::getSchema ( ) const
inline

Return the Schema that holds this record's fields and keys.

Definition at line 52 of file BaseRecord.h.

std::shared_ptr<BaseTable const> lsst::afw::table::BaseRecord::getTable ( ) const
inline

Return the table this record is associated with.

Definition at line 55 of file BaseRecord.h.

BaseRecord& lsst::afw::table::BaseRecord::operator= ( const BaseRecord &  )
delete
BaseRecord& lsst::afw::table::BaseRecord::operator= ( BaseRecord &&  )
delete
template<typename T >
Field<T>::Reference lsst::afw::table::BaseRecord::operator[] ( Key< T > const &  key)
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.

template<typename T >
Field<T>::ConstReference lsst::afw::table::BaseRecord::operator[] ( Key< T > const &  key) const
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.

template<typename Ref >
Ref lsst::afw::table::BaseRecord::operator[] ( ReferenceFunctorKey< Ref > const &  key)
inline

Definition at line 157 of file BaseRecord.h.

template<typename ConstRef >
ConstRef lsst::afw::table::BaseRecord::operator[] ( ConstReferenceFunctorKey< ConstRef > const &  key) const
inline

Definition at line 162 of file BaseRecord.h.

template<typename T , typename U >
void lsst::afw::table::BaseRecord::set ( Key< T > const &  key,
U const &  value 
)
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.

template<typename T , typename U >
void lsst::afw::table::BaseRecord::set ( InputFunctorKey< T > const &  key,
U const &  value 
)
inline

Set a calculated or aggregate field.

Definition at line 152 of file BaseRecord.h.

Friends And Related Function Documentation

friend class BaseColumnView
friend

Definition at line 187 of file BaseRecord.h.

friend class BaseTable
friend

Definition at line 186 of file BaseRecord.h.


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