2 #ifndef AFW_TABLE_BaseRecord_h_INCLUDED 3 #define AFW_TABLE_BaseRecord_h_INCLUDED 97 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been set up).");
99 return reinterpret_cast<typename
Field<T>::Element*
>(
reinterpret_cast<char*
>(_data) +
110 template <
typename T>
115 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been set up).");
117 return reinterpret_cast<typename
Field<T>::Element const*
>(
reinterpret_cast<char const*
>(_data) +
128 template <
typename T>
140 template <
typename T>
150 template <
typename T>
163 template <
typename T,
typename U>
165 key.setValue(
getElement(key), _manager, value);
171 template <
typename T>
173 return key.get(*
this);
179 template <
typename T,
typename U>
181 return key.set(*
this, value);
184 template <
typename Ref>
189 template <
typename ConstRef>
200 ndarray::Manager::Ptr
getManager()
const {
return _manager; }
223 ndarray::Manager::Ptr _manager;
226 template <
typename RecordT,
typename ...Args>
229 std::forward<Args>(args)...);
237 #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.
int getOffset() const noexcept
Return the offset (in bytes) of this field within a record.
friend std::ostream & operator<<(std::ostream &os, BaseRecord const &record)
Write the record's content out, one field on each line.
Helper struct that contains the information passed from BaseTable to BaseRecord at construction...
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
std::shared_ptr< RecordT > constructRecord(Args &&...args)
Helper function that must be used by all _makeRecord overrides to actually construct records...
ConstRef operator[](ConstReferenceFunctorKey< ConstRef > const &key) const
bool isValid() const noexcept
Return true if the key was initialized to valid offset.
virtual void _stream(std::ostream &os) const
Called by operator<<.
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.
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.
BaseRecord(ConstructionToken const &, detail::RecordData &&data)
Construct a record with uninitialized data.
A class used as a handle to a particular field in a table.
T Value
the type returned by BaseRecord::get
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
T & Reference
the type returned by BaseRecord::operator[] (non-const)
Base class for all tables.