|
lsst.afw
17.0.1-24-g0055ebd3c+3
|
Field base class specialization for arrays. More...
#include <FieldBase.h>
Public Types | |
| typedef ndarray::Array< U const, 1, 1 > | Value |
| the type returned by BaseRecord::get More... | |
| typedef ndarray::ArrayRef< U, 1, 1 > | Reference |
| the type returned by BaseRecord::operator[] More... | |
| typedef ndarray::ArrayRef< U const, 1, 1 > | ConstReference |
| the type returned by BaseRecord::operator[] (const) More... | |
| typedef U | Element |
| the type of subfields and array elements More... | |
Public Member Functions | |
| FieldBase (int size=0) | |
| Construct a FieldBase with the given size. More... | |
| FieldBase (FieldBase const &) noexcept=default | |
| FieldBase (FieldBase &&) noexcept=default | |
| FieldBase & | operator= (FieldBase const &) noexcept=default |
| FieldBase & | operator= (FieldBase &&) noexcept=default |
| ~FieldBase () noexcept=default | |
| int | getElementCount () const noexcept |
| Return the number of subfield elements (equal to the size of the array), or 0 for a variable-length array. More... | |
| int | getSize () const noexcept |
| Return the size of the array (equal to the number of subfield elements), or 0 for a variable-length array. More... | |
| bool | isVariableLength () const noexcept |
| Return true if the field is variable-length (each record can have a different size array). More... | |
Static Public Member Functions | |
| static std::string | getTypeString () |
| Return a string description of the field type. More... | |
Protected Member Functions | |
| void | stream (std::ostream &os) const |
| Defines how Fields are printed. More... | |
| Reference | getReference (Element *p, ndarray::Manager::Ptr const &m) const |
| Used to implement BaseRecord::operator[] (non-const). More... | |
| ConstReference | getConstReference (Element const *p, ndarray::Manager::Ptr const &m) const |
| Used to implement BaseRecord::operator[] (const). More... | |
| Value | getValue (Element const *p, ndarray::Manager::Ptr const &m) const |
| Used to implement BaseRecord::get. More... | |
| void | setValue (Element *p, ndarray::Manager::Ptr const &, ndarray::Array< Element, 1, 1 > const &value) const |
| Used to implement BaseRecord::set; accepts only non-const arrays of the right type. More... | |
| template<typename Derived > | |
| void | setValue (Element *p, ndarray::Manager::Ptr const &, ndarray::ExpressionBase< Derived > const &value) const |
| Used to implement BaseRecord::set; accepts any ndarray expression. More... | |
Static Protected Member Functions | |
| static FieldBase | makeDefault () noexcept |
| Needed to allow Keys to be default-constructed. More... | |
Field base class specialization for arrays.
The Array tag is used for both fixed-length (same size in every record, accessible via ColumnView) and variable-length arrays; variable-length arrays are initialized with a size of 0. Ideally, we'd use complete different tag classes for those two very different types, but boost::variant and boost::mpl put a limit of 20 on the number of field types, and we're running out. In a future reimplementation of afw::table, we should fix this.
Definition at line 99 of file FieldBase.h.
| typedef ndarray::ArrayRef<U const, 1, 1> lsst::afw::table::FieldBase< Array< U > >::ConstReference |
the type returned by BaseRecord::operator[] (const)
Definition at line 106 of file FieldBase.h.
| typedef U lsst::afw::table::FieldBase< Array< U > >::Element |
the type of subfields and array elements
Definition at line 108 of file FieldBase.h.
| typedef ndarray::ArrayRef<U, 1, 1> lsst::afw::table::FieldBase< Array< U > >::Reference |
the type returned by BaseRecord::operator[]
Definition at line 103 of file FieldBase.h.
| typedef ndarray::Array<U const, 1, 1> lsst::afw::table::FieldBase< Array< U > >::Value |
the type returned by BaseRecord::get
Definition at line 100 of file FieldBase.h.
|
inline |
Construct a FieldBase with the given size.
A size == 0 indicates a variable-length array. Negative sizes are not permitted.
This constructor is implicit with a default so it can be used in the Field constructor (as if it were an int argument) without specializing Field. In other words, it allows one to construct a 25-element array field like this:
Field< Array<float> >("name", "documentation", 25);
...even though the third argument to the Field constructor takes a FieldBase, not an int.
Definition at line 123 of file FieldBase.h.
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlineprotected |
Used to implement BaseRecord::operator[] (const).
Definition at line 165 of file FieldBase.h.
|
inlinenoexcept |
Return the number of subfield elements (equal to the size of the array), or 0 for a variable-length array.
Definition at line 140 of file FieldBase.h.
|
inlineprotected |
Used to implement BaseRecord::operator[] (non-const).
Definition at line 157 of file FieldBase.h.
|
inlinenoexcept |
Return the size of the array (equal to the number of subfield elements), or 0 for a variable-length array.
Definition at line 144 of file FieldBase.h.
|
static |
Return a string description of the field type.
Definition at line 63 of file FieldBase.cc.
|
inlineprotected |
Used to implement BaseRecord::get.
Definition at line 173 of file FieldBase.h.
|
inlinenoexcept |
Return true if the field is variable-length (each record can have a different size array).
Definition at line 147 of file FieldBase.h.
|
inlinestaticprotectednoexcept |
Needed to allow Keys to be default-constructed.
Definition at line 151 of file FieldBase.h.
|
defaultnoexcept |
|
defaultnoexcept |
|
inlineprotected |
Used to implement BaseRecord::set; accepts only non-const arrays of the right type.
Fixed-length arrays are handled by copying the data from value to p through p + _size. Variable-length arrays are handled by setting p to the address of value, an ndarray, hence a shallow copy (ndarray arrays are reference-counted so this will not leak memory). If you want deep assignment of variable-length data, use operator[] to get a reference and assign to that.
Definition at line 186 of file FieldBase.h.
|
inlineprotected |
Used to implement BaseRecord::set; accepts any ndarray expression.
Definition at line 197 of file FieldBase.h.
|
inlineprotected |
Defines how Fields are printed.
Definition at line 154 of file FieldBase.h.
1.8.13