Class BaseRecord¶
Defined in File BaseRecord.h
Inheritance Relationships¶
Derived Types¶
public lsst::afw::detection::PeakRecord
(Class PeakRecord)public lsst::afw::table::ExposureRecord
(Class ExposureRecord)public lsst::afw::table::SimpleRecord
(Class SimpleRecord)
Class Documentation¶
-
class
BaseRecord
¶ 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.
Subclassed by lsst::afw::detection::PeakRecord, lsst::afw::table::ExposureRecord, lsst::afw::table::SimpleRecord
Public Types
-
typedef BaseColumnView
ColumnView
¶ The associated ColumnView class.
-
typedef CatalogT<BaseRecord>
Catalog
¶ Template of CatalogT used to hold records of this type.
-
typedef CatalogT<BaseRecord const>
ConstCatalog
¶ Template of CatalogT used to hold const records of this type.
Public Functions
-
BaseRecord
(ConstructionToken const&, detail::RecordData &&data)¶ Construct a record with uninitialized data.
Access to this constructor is restricted to BaseTable and BaseRecord subclasses via the ConstructionToken argument, which can only be constructed by BaseTable. This constructor is public so it can still be called by std::make_shared code with access to ConstructionToken.
-
BaseRecord
(const BaseRecord&)¶
-
BaseRecord &
operator=
(const BaseRecord&)¶
-
BaseRecord
(BaseRecord&&)¶
-
BaseRecord &
operator=
(BaseRecord&&)¶
-
template<typename
T
>
Field<T>::Element *getElement
(Key<T> const &key)¶ 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.
-
template<typename
T
>
Field<T>::Element const *getElement
(Key<T> const &key) const¶ 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.
-
template<typename
T
>
Field<T>::Referenceoperator[]
(Key<T> const &key)¶ Return a reference (or reference-like type) to the field’s value.
Some field types (Point, Moments, Flag, Covariance, and SpherePoint) do not support reference access.
No checking is done to ensure the Key belongs to the correct schema.
-
template<typename
T
>
Field<T>::ConstReferenceoperator[]
(Key<T> const &key) const¶ Return a const reference (or const-reference-like type) to the field’s value.
Some field types (Point, Moments, Flag, Covariance, and SpherePoint) do not support reference access.
No checking is done to ensure the Key belongs to the correct schema.
-
template<typename
T
>
Field<T>::Valueget
(Key<T> const &key) const¶ Return the value of a field for the given key.
No checking is done to ensure the Key belongs to the correct schema.
-
template<typename
T
, typenameU
>
voidset
(Key<T> const &key, U const &value)¶ 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.
-
template<typename
T
>
Tget
(OutputFunctorKey<T> const &key) const¶ Compute a calculated or aggregate field.
-
template<typename
T
, typenameU
>
voidset
(InputFunctorKey<T> const &key, U const &value)¶ Set a calculated or aggregate field.
-
template<typename
ConstRef
>
ConstRefoperator[]
(ConstReferenceFunctorKey<ConstRef> const &key) const¶
-
void
assign
(BaseRecord const &other)¶ Copy all field values from other to this, requiring that they have equal schemas.
-
void
assign
(BaseRecord const &other, SchemaMapper const &mapper)¶ Copy field values from other to this, using a mapper.
-
ndarray::Manager::Ptr
getManager
() const¶
-
virtual
~BaseRecord
()¶
Protected Functions
-
virtual void
_assign
(BaseRecord const &other)¶ Called by assign() after transferring fields to allow subclass data members to be copied.
-
virtual void
_stream
(std::ostream &os) const¶ Called by operator<<. Overrides should call the base class implementation and append additional fields on new lines, with the syntax “%(name)s: %(value)s”.
Friends
-
std::ostream &
operator<<
(std::ostream &os, BaseRecord const &record)¶ Write the record’s content out, one field on each line.
-
typedef BaseColumnView