2 #ifndef AFW_TABLE_BaseRecord_h_INCLUDED 3 #define AFW_TABLE_BaseRecord_h_INCLUDED 71 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been setup).");
73 return reinterpret_cast<typename
Field<T>::Element*
>(
reinterpret_cast<char*
>(_data) +
89 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been setup).");
91 return reinterpret_cast<typename
Field<T>::Element const*
>(
reinterpret_cast<char const*
>(_data) +
102 template <
typename T>
114 template <
typename T>
124 template <
typename T>
137 template <
typename T,
typename U>
139 key.setValue(
getElement(key), _manager, value);
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>
174 ndarray::Manager::Ptr
getManager()
const {
return _manager; }
191 table->_initialize(*
this);
201 ndarray::Manager::Ptr _manager;
207 #endif // !AFW_TABLE_BaseRecord_h_INCLUDED Defines the fields and offsets for a table.
Base class for objects that can extract a value from a record, but are not a true Key themselves...
Column-wise view into a sequence of records that have been allocated contiguously.
Field< T >::Reference operator[](Key< T > const &key)
Return a reference (or reference-like type) to the field's value.
friend std::ostream & operator<<(std::ostream &os, BaseRecord const &record)
Write the record's content out, one field on each line.
int getOffset() const
Return the offset (in bytes) of this field within a record.
Field< T >::ConstReference operator[](Key< T > const &key) const
Return a const reference (or const-reference-like type) to the field's value.
A mapping between the keys of two Schemas, used to copy data between them.
CatalogT< BaseRecord > Catalog
Template of CatalogT used to hold records of this type.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied...
ItemVariant const * other
ConstRef operator[](ConstReferenceFunctorKey< ConstRef > const &key) const
virtual void _stream(std::ostream &os) const
Called by operator<<.
bool isValid() const
Return true if the key was initialized to valid offset.
virtual T getReference(BaseRecord &record) const =0
ndarray::Manager::Ptr getManager() const
CatalogT< BaseRecord const > ConstCatalog
Template of CatalogT used to hold const records of this type.
A base class for image defects.
Reference getReference(Element *p, ndarray::Manager::Ptr const &) const
Used to implement BaseRecord::operator[] (non-const).
ConstReference getConstReference(Element const *p, ndarray::Manager::Ptr const &) const
Used to implement BaseRecord::operator[] (const).
BaseTable Table
The associated table class.
Base class for objects that can return a const reference to part of a record, but are not a true Key...
Ref operator[](ReferenceFunctorKey< Ref > const &key)
Field< T >::Element const * getElement(Key< T > const &key) const
Return a pointer to the underlying elements of a field (const).
Schema getSchema() const
Return the Schema that holds this record's fields and keys.
BaseRecord(std::shared_ptr< BaseTable > const &table)
Construct a record with uninitialized data.
Base class for objects that can return a non-const reference to part of a record, but are not a true ...
Field< T >::Element * getElement(Key< T > const &key)
Return a pointer to the underlying elements of a field (non-const).
std::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
#define LSST_EXCEPT(type,...)
Base class for all records.
A class used as a handle to a particular field in a table.
T Value
the type returned by BaseRecord::get
Citizen(const std::type_info &)
virtual T getConstReference(BaseRecord const &record) const =0
FieldBase< T >::Element Element
Type used to store field data in the table (a field may have multiple elements).
void assign(BaseRecord const &other)
Copy all field values from other to this, requiring that they have equal schemas. ...
T const & ConstReference
the type returned by BaseRecord::operator[] (const)
BaseColumnView ColumnView
The associated ColumnView class.
BaseRecord & operator=(const BaseRecord &)=delete
BaseRecord(const BaseRecord &)=delete
T & Reference
the type returned by BaseRecord::operator[] (non-const)
Base class for all tables.