|
lsst.afw
14.0-38-g278b05818
|
A class used as a handle to a particular field in a table. More...
#include <fwd.h>
Public Types | |
| typedef T | Value |
| the type returned by BaseRecord::get More... | |
| typedef T & | Reference |
| the type returned by BaseRecord::operator[] (non-const) More... | |
| typedef T const & | ConstReference |
| the type returned by BaseRecord::operator[] (const) More... | |
| typedef T | Element |
| the type of subfields (the same as the type itself for scalars) More... | |
Public Member Functions | |
| int | getOffset () const |
| Return the offset (in bytes) of this field within a record. More... | |
| bool | isValid () const |
| Return true if the key was initialized to valid offset. More... | |
| Key () | |
| Default construct a field. More... | |
| int | getElementCount () const |
| Return the number of subfield elements (always one for scalars). More... | |
| template<typename OtherT > | |
| bool | operator== (Key< OtherT > const &other) const |
| Equality comparison. More... | |
| template<typename OtherT > | |
| bool | operator!= (Key< OtherT > const &other) const |
| Equality comparison. More... | |
| bool | operator== (Key const &other) const |
| Equality comparison. More... | |
| bool | operator!= (Key const &other) const |
| Equality comparison. More... | |
Static Public Member Functions | |
| static std::string | getTypeString () |
| Return a string description of the field type. More... | |
Static Public Attributes | |
| static bool const | HAS_NAMED_SUBFIELDS = false |
Protected Member Functions | |
| void | stream (std::ostream &os) const |
| Defines how Fields are printed. More... | |
| Reference | getReference (Element *p, ndarray::Manager::Ptr const &) const |
| Used to implement BaseRecord::operator[] (non-const). More... | |
| ConstReference | getConstReference (Element const *p, ndarray::Manager::Ptr const &) const |
| Used to implement BaseRecord::operator[] (const). More... | |
| Value | getValue (Element const *p, ndarray::Manager::Ptr const &) const |
| Used to implement BaseRecord::get. More... | |
| void | setValue (Element *p, ndarray::Manager::Ptr const &, Value v) const |
| Used to implement BaseRecord::set. More... | |
Static Protected Member Functions | |
| static FieldBase | makeDefault () |
| Needed to allow Keys to be default-constructed. More... | |
Friends | |
| class | detail::Access |
| class | BaseRecord |
| std::ostream & | operator<< (std::ostream &os, Key< T > const &key) |
| Stringification. More... | |
A class used as a handle to a particular field in a table.
All access to table data ultimately goes through Key objects, which know (via an internal offset) how to address and cast the internal data buffer of a record or table.
Keys can be obtained from a Schema by name:
schema.find("myfield").key
and are also returned when a new field is added. Compound and array keys also provide accessors to retrieve scalar keys to their elements (see the documentation for the KeyBase specializations), even though these element keys do not correspond to a field that exists in any Schema. For example:
Schema schema;
Key< Array<float> > arrayKey = schema.addField< Array<float> >("array", "docs for array", 5);
Key< Point<int> > pointKey = schema.addField< Point<int> >("point", "docs for point");
Key<float> elementKey = arrayKey[3];
Key<int> xKey = pointKey.getX();
std::shared_ptr<BaseTable> table = BaseTable::make(schema);
std::shared_ptr<BaseRecord> record = table.makeRecord();
assert(&record[arrayKey][3] == &record[elementKey3]);
assert(record.get(pointKey).getX() == record[xKey]);
Key inherits from FieldBase to allow a key for a dynamically-sized field to know its size without needing to specialize Key itself or hold a full Field object.
|
inherited |
the type returned by BaseRecord::operator[] (const)
Definition at line 47 of file FieldBase.h.
|
inherited |
the type of subfields (the same as the type itself for scalars)
Definition at line 48 of file FieldBase.h.
|
inherited |
the type returned by BaseRecord::operator[] (non-const)
Definition at line 46 of file FieldBase.h.
|
inherited |
the type returned by BaseRecord::get
Definition at line 45 of file FieldBase.h.
|
inline |
|
inlineprotectedinherited |
Used to implement BaseRecord::operator[] (const).
Definition at line 76 of file FieldBase.h.
|
inlineinherited |
Return the number of subfield elements (always one for scalars).
Definition at line 51 of file FieldBase.h.
|
inline |
|
inlineprotectedinherited |
Used to implement BaseRecord::operator[] (non-const).
Definition at line 73 of file FieldBase.h.
|
staticinherited |
Return a string description of the field type.
|
inlineprotectedinherited |
Used to implement BaseRecord::get.
Definition at line 79 of file FieldBase.h.
|
inline |
|
inlinestaticprotectedinherited |
Needed to allow Keys to be default-constructed.
Definition at line 67 of file FieldBase.h.
|
inline |
Equality comparison.
Two keys with different types are never equal. Keys with the same type are equal if they point to the same location in a table, regardless of what Schema they were constructed from (for instance, if a field has a different name in one Schema than another, but is otherwise the same, the two keys will be equal).
|
inline |
Equality comparison.
Two keys with different types are never equal. Keys with the same type are equal if they point to the same location in a table, regardless of what Schema they were constructed from (for instance, if a field has a different name in one Schema than another, but is otherwise the same, the two keys will be equal).
|
inline |
Equality comparison.
Two keys with different types are never equal. Keys with the same type are equal if they point to the same location in a table, regardless of what Schema they were constructed from (for instance, if a field has a different name in one Schema than another, but is otherwise the same, the two keys will be equal).
|
inline |
Equality comparison.
Two keys with different types are never equal. Keys with the same type are equal if they point to the same location in a table, regardless of what Schema they were constructed from (for instance, if a field has a different name in one Schema than another, but is otherwise the same, the two keys will be equal).
|
inlineprotectedinherited |
Used to implement BaseRecord::set.
Definition at line 82 of file FieldBase.h.
|
inlineprotectedinherited |
Defines how Fields are printed.
Definition at line 70 of file FieldBase.h.
|
friend |
|
friend |
|
friend |
|
staticinherited |
1.8.13