LSST Applications g07dc498a13+7851b72aa9,g1409bbee79+7851b72aa9,g1a7e361dbc+7851b72aa9,g1fd858c14a+a4e18a0dda,g33399d78f5+a0324bbf49,g35bb328faa+e55fef2c71,g3bd4b5ce2c+8524b1c0c8,g53246c7159+e55fef2c71,g579b87e3d2+a58ba40925,g60b5630c4e+7b4465799a,g78460c75b0+8427c4cc8f,g78619a8342+5517f7db9e,g786e29fd12+307f82e6af,g8534526c7b+8e1c6b434f,g89139ef638+7851b72aa9,g8b49a6ea8e+7b4465799a,g8ffcb69f3d+0065d7bbc8,g9125e01d80+e55fef2c71,g97b8272a79+a8c4cb337e,g989de1cb63+7851b72aa9,g9f33ca652e+747bd1f1f9,gaaedd4e678+7851b72aa9,gabe3b4be73+9c0c3c7524,gb1101e3267+c03a154bbb,gb58c049af0+28045f66fd,gc1fe0db326+7b4465799a,gca43fec769+e55fef2c71,gce7788e931+99adca4f64,gcf25f946ba+a0324bbf49,gd397e13551+18f805d5e0,gd6cbbdb0b4+f6e5445f66,gde0f65d7ad+78b6ec8427,ge278dab8ac+b4c2c8faf7,geab183fbe5+7b4465799a,gecb8035dfe+1f480bec5e,gf58bf46354+e55fef2c71,gf92a8ffd38+e7bc33f3ea,gfe7187db8c+38a2c5c626,w.2025.03
LSST Data Management Base Package
|
Field base class specialization for strings. More...
#include <FieldBase.h>
Public Types | |
using | Value = std::string |
the type returned by BaseRecord::get | |
using | Reference = char * |
the type returned by BaseRecord::operator[] | |
using | ConstReference = const char * |
the type returned by BaseRecord::operator[] (const) | |
using | Element = char |
the type of subfields and array elements | |
Public Member Functions | |
FieldBase (std::size_t size=std::numeric_limits< size_t >::max()) | |
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 string, including a null terminator), or 0 for a variable-length string. | |
std::size_t | getSize () const noexcept |
Return the maximum length of the string, including a null terminator (equal to the number of subfield elements), or 0 for a variable-length string. | |
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 &, std::string const &value) const |
Used to implement BaseRecord::set Fixed-lengths strings are handled by copying the data into p through p + _size , nulling extra characters, if any. | |
Static Protected Member Functions | |
static FieldBase | makeDefault () noexcept |
Needed to allow Keys to be default-constructed. | |
Field base class specialization for strings.
Definition at line 218 of file FieldBase.h.
using lsst::afw::table::FieldBase< std::string >::ConstReference = const char * |
the type returned by BaseRecord::operator[] (const)
Definition at line 225 of file FieldBase.h.
using lsst::afw::table::FieldBase< std::string >::Element = char |
the type of subfields and array elements
Definition at line 227 of file FieldBase.h.
using lsst::afw::table::FieldBase< std::string >::Reference = char * |
the type returned by BaseRecord::operator[]
Definition at line 222 of file FieldBase.h.
using lsst::afw::table::FieldBase< std::string >::Value = std::string |
the type returned by BaseRecord::get
Definition at line 219 of file FieldBase.h.
lsst::afw::table::FieldBase< std::string >::FieldBase | ( | std::size_t | size = std::numeric_limits<size_t>::max() | ) |
Construct a FieldBase with the given size.
A size == 0 indicates a variable-length string. Negative sizes are not permitted.
This constructor is implicit and has an invalid 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-character string field like this:
Field< std::string >("name", "documentation", 25);
...even though the third argument to the Field constructor takes a FieldBase, not an int.
Definition at line 69 of file FieldBase.cc.
|
defaultnoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlineprotected |
Used to implement BaseRecord::operator[] (const).
Definition at line 283 of file FieldBase.h.
|
inlinenoexcept |
Return the number of subfield elements (equal to the size of the string, including a null terminator), or 0 for a variable-length string.
Definition at line 255 of file FieldBase.h.
|
inlineprotected |
Used to implement BaseRecord::operator[] (non-const).
Definition at line 272 of file FieldBase.h.
|
inlinenoexcept |
Return the maximum length of the string, including a null terminator (equal to the number of subfield elements), or 0 for a variable-length string.
Definition at line 259 of file FieldBase.h.
|
static |
Return a string description of the field type.
Definition at line 72 of file FieldBase.cc.
|
protected |
Used to implement BaseRecord::get.
Definition at line 74 of file FieldBase.cc.
|
inlinenoexcept |
Return true if the field is variable-length (each record can have a different size array).
Definition at line 262 of file FieldBase.h.
|
inlinestaticprotectednoexcept |
Needed to allow Keys to be default-constructed.
Definition at line 266 of file FieldBase.h.
|
defaultnoexcept |
|
defaultnoexcept |
|
protected |
Used to implement BaseRecord::set Fixed-lengths strings are handled by copying the data into p
through p + _size
, nulling extra characters, if any.
The data is only null-terminated if value.size() < _size. Variable-length strings are handled by setting p
to the address of a std::string
that is a copy of value
Definition at line 87 of file FieldBase.cc.
|
inlineprotected |
Defines how Fields are printed.
Definition at line 269 of file FieldBase.h.