LSST Applications 27.0.0,g0265f82a02+469cd937ee,g02d81e74bb+21ad69e7e1,g1470d8bcf6+cbe83ee85a,g2079a07aa2+e67c6346a6,g212a7c68fe+04a9158687,g2305ad1205+94392ce272,g295015adf3+81dd352a9d,g2bbee38e9b+469cd937ee,g337abbeb29+469cd937ee,g3939d97d7f+72a9f7b576,g487adcacf7+71499e7cba,g50ff169b8f+5929b3527e,g52b1c1532d+a6fc98d2e7,g591dd9f2cf+df404f777f,g5a732f18d5+be83d3ecdb,g64a986408d+21ad69e7e1,g858d7b2824+21ad69e7e1,g8a8a8dda67+a6fc98d2e7,g99cad8db69+f62e5b0af5,g9ddcbc5298+d4bad12328,ga1e77700b3+9c366c4306,ga8c6da7877+71e4819109,gb0e22166c9+25ba2f69a1,gb6a65358fc+469cd937ee,gbb8dafda3b+69d3c0e320,gc07e1c2157+a98bf949bb,gc120e1dc64+615ec43309,gc28159a63d+469cd937ee,gcf0d15dbbd+72a9f7b576,gdaeeff99f8+a38ce5ea23,ge6526c86ff+3a7c1ac5f1,ge79ae78c31+469cd937ee,gee10cc3b42+a6fc98d2e7,gf1cff7945b+21ad69e7e1,gfbcc870c63+9a11dc8c8f
LSST Data Management Base Package
|
Field base class specialization for arrays. More...
#include <FieldBase.h>
Public Types | |
using | Value = ndarray::Array<const U, 1, 1> |
the type returned by BaseRecord::get | |
using | Reference = ndarray::ArrayRef<U, 1, 1> |
the type returned by BaseRecord::operator[] | |
using | ConstReference = ndarray::ArrayRef<const U, 1, 1> |
the type returned by BaseRecord::operator[] (const) | |
using | Element = U |
the type of subfields and array elements | |
Public Member Functions | |
FieldBase (size_t size=0) | |
Construct a FieldBase with the given size. | |
FieldBase (FieldBase const &) noexcept=default | |
FieldBase (FieldBase &&) noexcept=default | |
FieldBase & | operator= (FieldBase const &) noexcept=default |
FieldBase & | operator= (FieldBase &&) noexcept=default |
~FieldBase () noexcept=default | |
std::size_t | getElementCount () const noexcept |
Return the number of subfield elements (equal to the size of the array), or 0 for a variable-length array. | |
std::size_t | getSize () const noexcept |
Return the size of the array (equal to the number of subfield elements), or 0 for a variable-length array. | |
bool | isVariableLength () const noexcept |
Return true if the field is variable-length (each record can have a different size array). | |
Static Public Member Functions | |
static std::string | getTypeString () |
Return a string description of the field type. | |
Protected Member Functions | |
void | stream (std::ostream &os) const |
Defines how Fields are printed. | |
Reference | getReference (Element *p, ndarray::Manager::Ptr const &m) const |
Used to implement BaseRecord::operator[] (non-const). | |
ConstReference | getConstReference (Element const *p, ndarray::Manager::Ptr const &m) const |
Used to implement BaseRecord::operator[] (const). | |
Value | getValue (Element const *p, ndarray::Manager::Ptr const &m) const |
Used to implement BaseRecord::get. | |
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. | |
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. | |
Static Protected Member Functions | |
static FieldBase | makeDefault () noexcept |
Needed to allow Keys to be default-constructed. | |
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 this was limited in the original (pre-C++11) implementation and now it would be an API change.
Definition at line 96 of file FieldBase.h.
using lsst::afw::table::FieldBase< Array< U > >::ConstReference = ndarray::ArrayRef<const U, 1, 1> |
the type returned by BaseRecord::operator[] (const)
Definition at line 103 of file FieldBase.h.
the type of subfields and array elements
Definition at line 105 of file FieldBase.h.
using lsst::afw::table::FieldBase< Array< U > >::Reference = ndarray::ArrayRef<U, 1, 1> |
the type returned by BaseRecord::operator[]
Definition at line 100 of file FieldBase.h.
using lsst::afw::table::FieldBase< Array< U > >::Value = ndarray::Array<const U, 1, 1> |
the type returned by BaseRecord::get
Definition at line 97 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 120 of file FieldBase.h.
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlineprotected |
Used to implement BaseRecord::operator[] (const).
Definition at line 159 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 134 of file FieldBase.h.
|
inlineprotected |
Used to implement BaseRecord::operator[] (non-const).
Definition at line 151 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 138 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 167 of file FieldBase.h.
|
inlinenoexcept |
Return true if the field is variable-length (each record can have a different size array).
Definition at line 141 of file FieldBase.h.
|
inlinestaticprotectednoexcept |
Needed to allow Keys to be default-constructed.
Definition at line 145 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 180 of file FieldBase.h.
|
inlineprotected |
Used to implement BaseRecord::set; accepts any ndarray expression.
Definition at line 191 of file FieldBase.h.
|
inlineprotected |
Defines how Fields are printed.
Definition at line 148 of file FieldBase.h.