2 #ifndef LSST_AFW_TABLE_Flag_h_INCLUDED
3 #define LSST_AFW_TABLE_Flag_h_INCLUDED
46 throw LSST_EXCEPT(lsst::pex::exceptions::LogicError,
47 "Constructor disabled (this Field type is not sized).");
52 void stream(std::ostream &os)
const {}
91 template <
typename OtherT>
95 template <
typename OtherT>
100 bool operator==(
Key const &other)
const {
return _offset == other._offset && _bit == other._bit; }
128 inline friend std::ostream &operator<<(std::ostream &os, Key<Flag>
const &key) {
130 <<
", bit=" << key.getBit() <<
")";
139 return (*p) & (
Element(1) << _bit);
151 explicit Key(
int offset,
int bit) : _offset(offset), _bit(bit) {}
160 #endif // !LSST_AFW_TABLE_Flag_h_INCLUDED
Field base class default implementation (used for numeric scalars and Angle).
Key()
Default construct a field.
bool Value
the type returned by BaseRecord::get
bool operator!=(Key const &other) const
Equality comparison.
bool operator==(Key< OtherT > const &other) const
Equality comparison.
bool operator!=(Key< OtherT > const &other) const
Equality comparison.
bool operator==(Key const &other) const
Equality comparison.
void stream(std::ostream &os) const
Defines how fields are printed.
int getBit() const
The index of this field's bit within the integer it shares with other Flag fields.
int getOffset() const
Return the offset in bytes of the integer element that holds this field's bit.
int getElementCount() const
Return the number of subfield elements (always one for scalars).
static std::string getTypeString()
Return a string description of the field type.
static bool const HAS_NAMED_SUBFIELDS
T Element
the type of subfields (the same as the type itself for scalars)
A base class for Key that allows subfield keys to be extracted for some field types.
Base class for all records.
A class used as a handle to a particular field in a table.
T Value
the type returned by BaseRecord::get
void setValue(Element *p, ndarray::Manager::Ptr const &, Value v) const
Used to implement BaseRecord::set.
Key()
Default construct a field.
bool operator==(Key< OtherT > const &other) const
Equality comparison.
std::int64_t Element
the actual storage type (shared by multiple flag fields)
bool isValid() const
Return true if the key was initialized to valid offset.
Value getValue(Element const *p, ndarray::Manager::Ptr const &) const
Used to implement BaseRecord::get.
static std::string getTypeString()
Return a string description of the field type.