LSST Applications
21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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 More... | |
using | Reference = ndarray::ArrayRef< U, 1, 1 > |
the type returned by BaseRecord::operator[] More... | |
using | ConstReference = ndarray::ArrayRef< const U, 1, 1 > |
the type returned by BaseRecord::operator[] (const) More... | |
using | Element = U |
the type of subfields and array elements More... | |
Public Member Functions | |
FieldBase (size_t 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 | |
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. More... | |
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. 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 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.
using lsst::afw::table::FieldBase< Array< U > >::Element = U |
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 |
|
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 |
|
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 |