2 #ifndef AFW_TABLE_BaseRecord_h_INCLUDED
3 #define AFW_TABLE_BaseRecord_h_INCLUDED
11 namespace lsst {
namespace afw {
namespace table {
30 private boost::noncopyable
64 pex::exceptions::LogicError,
65 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been setup)."
84 pex::exceptions::LogicError,
85 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been setup)."
100 template <
typename T>
112 template <
typename T>
122 template <
typename T>
135 template <
typename T,
typename U>
145 template <
typename T>
147 return key.get(*
this);
153 template <
typename T,
typename U>
155 return key.
set(*
this, value);
158 template <
typename Ref>
163 template <
typename ConstRef>
203 #endif // !AFW_TABLE_BaseRecord_h_INCLUDED
CatalogT< BaseRecord > Catalog
Template of CatalogT used to hold records of this type.
Field< T >::ConstReference operator[](Key< T > const &key) const
Return a const reference (or const-reference-like type) to the field's value.
Defines the fields and offsets for a table.
Ref operator[](ReferenceFunctorKey< Ref > const &key)
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
Column-wise view into a sequence of records that have been allocated contiguously.
int getOffset() const
Return the offset (in bytes) of this field within a record.
BaseTable Table
The associated table class.
ndarray::Manager::Ptr getManager() const
A custom container class for records, based on std::vector.
A mapping between the keys of two Schemas, used to copy data between them.
boost::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied...
Field< T >::Reference operator[](Key< T > const &key)
Return a reference (or reference-like type) to the field's value.
virtual T getReference(BaseRecord &record) const =0
bool isValid() const
Return true if the key was initialized to valid offset.
void _initialize(BaseRecord &record)
void setValue(Element *p, ndarray::Manager::Ptr const &, Value v) const
Used to implement RecordBase::set.
T const & ConstReference
the type returned by BaseRecord::operator[] (const)
std::map< Citizen const *, CitizenInfo > table
boost::intrusive_ptr< Manager > Ptr
ConstReference getConstReference(Element const *p, ndarray::Manager::Ptr const &) const
Used to implement RecordBase::operator[] (const).
boost::shared_ptr< BaseTable > _table
FieldBase< T >::Element Element
Type used to store field data in the table (a field may have multiple elements).
CatalogT< BaseRecord const > ConstCatalog
Template of CatalogT used to hold const records of this type.
Field< T >::Element const * getElement(Key< T > const &key) const
Return a pointer to the underlying elements of a field (const).
T Value
the type returned by BaseRecord::get
virtual T getConstReference(BaseRecord const &record) const =0
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. ...
Field< T >::Element * getElement(Key< T > const &key)
Return a pointer to the underlying elements of a field (non-const).
#define LSST_EXCEPT(type,...)
Base class for all records.
A class used as a handle to a particular field in a table.
void set(InputFunctorKey< T > const &key, U const &value)
Set a calculated or aggregate field.
Citizen(const std::type_info &)
T & Reference
the type returned by BaseRecord::operator[] (non-const)
ndarray::Manager::Ptr _manager
BaseColumnView ColumnView
The associated ColumnView class.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
Reference getReference(Element *p, ndarray::Manager::Ptr const &) const
Used to implement RecordBase::operator[] (non-const).
Citizen is a class that should be among all LSST classes base classes, and handles basic memory manag...
BaseRecord(boost::shared_ptr< BaseTable > const &table)
Construct a record with uninitialized data.
Base class for all tables.