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>
112 if (!key.isValid()) {
115 "Key is not valid (if this is a SourceRecord, make sure slot aliases have been set up).");
128 template <
typename T>
130 return key.getReference(
getElement(key), _manager);
140 template <
typename T>
142 return key.getConstReference(
getElement(key), _manager);
150 template <
typename T>
152 return key.getValue(
getElement(key), _manager);
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>
186 return key.getReference(*
this);
189 template <
typename ConstRef>
191 return key.getConstReference(*
this);
200 ndarray::Manager::Ptr
getManager()
const {
return _manager; }
223 ndarray::Manager::Ptr _manager;
226template <
typename RecordT,
typename ...Args>
229 std::forward<Args>(
args)...);
#define LSST_EXCEPT(type,...)
Tag types used to declare specialized field types.
Column-wise view into a sequence of records that have been allocated contiguously.
Base class for all records.
Ref operator[](ReferenceFunctorKey< Ref > const &key)
Field< T >::Value get(Key< T > const &key) const
Return the value of a field for the given key.
Field< T >::Element * getElement(Key< T > const &key)
Return a pointer to the underlying elements of a field (non-const).
void assign(BaseRecord const &other)
Copy all field values from other to this, requiring that they have equal schemas.
ConstRef operator[](ConstReferenceFunctorKey< ConstRef > const &key) const
std::shared_ptr< BaseTable const > getTable() const
Return the table this record is associated with.
BaseRecord & operator=(BaseRecord &&)=delete
Field< T >::Reference operator[](Key< T > const &key)
Return a reference (or reference-like type) to the field's value.
BaseRecord & operator=(const BaseRecord &)=delete
BaseRecord(BaseRecord &&)=delete
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.
ndarray::Manager::Ptr getManager() const
void set(InputFunctorKey< T > const &key, U const &value)
Set a calculated or aggregate field.
BaseRecord(const BaseRecord &)=delete
friend class BaseColumnView
BaseRecord(ConstructionToken const &, detail::RecordData &&data)
Construct a record with uninitialized data.
void set(Key< T > const &key, U const &value)
Set value of a field for the given key.
T get(OutputFunctorKey< T > const &key) const
Compute a calculated or aggregate field.
virtual void _assign(BaseRecord const &other)
Called by assign() after transferring fields to allow subclass data members to be copied.
friend std::ostream & operator<<(std::ostream &os, BaseRecord const &record)
Write the record's content out, one field on each line.
virtual void _stream(std::ostream &os) const
Called by operator<<.
Field< T >::ConstReference operator[](Key< T > const &key) const
Return a const reference (or const-reference-like type) to the field's value.
Base class for all tables.
std::shared_ptr< RecordT > constructRecord(Args &&... args)
Helper function that must be used by all _makeRecord overrides to actually construct records.
Defines the fields and offsets for a table.
A mapping between the keys of two Schemas, used to copy data between them.
const T & ConstReference
the type returned by BaseRecord::operator[] (const)
T & Reference
the type returned by BaseRecord::operator[] (non-const)
T Value
the type returned by BaseRecord::get
typename FieldBase< T >::Element Element
Type used to store field data in the table (a field may have multiple elements).
Helper struct that contains the information passed from BaseTable to BaseRecord at construction.