lsst.afw gf03f0b42f3+f620a9ee49
Loading...
Searching...
No Matches
lsst::afw::table::Key< Flag > Class Reference

Key specialization for Flag. More...

#include <Flag.h>

Inheritance diagram for lsst::afw::table::Key< Flag >:
lsst::afw::table::KeyBase< Flag > lsst::afw::table::FieldBase< Flag > lsst::afw::table::KeyBase< Flag > lsst::afw::table::FieldBase< Flag >

Public Types

using Value
 the type returned by BaseRecord::get
 
using Reference
 the type returned by BaseRecord::operator[] (non-const)
 
using ConstReference
 the type returned by BaseRecord::operator[] (const)
 
using Element
 the type of subfields (the same as the type itself for scalars)
 

Public Member Functions

template<typename OtherT>
bool operator== (Key< OtherT > const &other) const
 Equality comparison.
 
template<typename OtherT>
bool operator!= (Key< OtherT > const &other) const
 
bool operator== (Key const &other) const
 
bool operator!= (Key const &other) const
 
std::size_t hash_value () const noexcept
 Return a hash of this object.
 
std::size_t getOffset () const
 Return the offset in bytes of the integer element that holds this field's bit.
 
std::size_t getBit () const
 The index of this field's bit within the integer it shares with other Flag fields.
 
bool isValid () const
 Return true if the key was initialized to valid offset.
 
 Key ()
 Default construct a field.
 
 Key (Key const &)=default
 
 Key (Key &&)=default
 
Keyoperator= (Key const &)=default
 
Keyoperator= (Key &&)=default
 
 ~Key ()=default
 
bool operator== (Key< OtherT > const &other) const noexcept
 Equality comparison.
 
bool operator== (Key const &other) const noexcept
 
bool operator!= (Key< OtherT > const &other) const noexcept
 
bool operator!= (Key const &other) const noexcept
 
std::size_t hash_value () const noexcept
 Return a hash of this object.
 
std::size_t getOffset () const noexcept
 Return the offset (in bytes) of this field within a record.
 
bool isValid () const noexcept
 Return true if the key was initialized to valid offset.
 
 Key () noexcept
 Default construct a field.
 
 Key (Key const &) noexcept=default
 
 Key (Key &&) noexcept=default
 
Keyoperator= (Key const &) noexcept=default
 
Keyoperator= (Key &&) noexcept=default
 
 ~Key () noexcept=default
 
std::size_t getElementCount () const noexcept
 Return the number of subfield elements (always one for scalars).
 
Key< FieldBase< Flag >::ElementgetStorage () const
 Return a key corresponding to the integer element where this field's bit is packed.
 

Static Public Member Functions

static std::string getTypeString ()
 Return a string description of the field type.
 

Static Public Attributes

static bool const HAS_NAMED_SUBFIELDS
 

Protected Member Functions

void stream (std::ostream &os) const
 Defines how Fields are printed.
 
Reference getReference (Element *p, ndarray::Manager::Ptr const &) const
 Used to implement BaseRecord::operator[] (non-const).
 
ConstReference getConstReference (Element const *p, ndarray::Manager::Ptr const &) const
 Used to implement BaseRecord::operator[] (const).
 
Value getValue (Element const *p, ndarray::Manager::Ptr const &) const
 Used to implement BaseRecord::get.
 
void setValue (Element *p, ndarray::Manager::Ptr const &, Value v) const
 Used to implement BaseRecord::set.
 
Reference getReference (Element *p, ndarray::Manager::Ptr const &) const
 Used to implement BaseRecord::operator[] (non-const).
 
ConstReference getConstReference (Element const *p, ndarray::Manager::Ptr const &) const
 Used to implement BaseRecord::operator[] (const).
 
Value getValue (Element const *p, ndarray::Manager::Ptr const &) const
 Used to implement BaseRecord::get.
 
void setValue (Element *p, ndarray::Manager::Ptr const &, Value v) const
 Used to implement BaseRecord::set.
 

Static Protected Member Functions

static FieldBase makeDefault () noexcept
 Needed to allow Keys to be default-constructed.
 

Friends

class detail::Access
 
class BaseRecord
 
std::ostreamoperator<< (std::ostream &os, Key< Flag > const &key)
 Stringification.
 
class detail::Access
 
class BaseRecord
 
std::ostreamoperator<< (std::ostream &os, Key< Flag > const &key)
 Stringification.
 

Detailed Description

Key specialization for Flag.

Flag fields are special; their keys need to contain not only the offset to the integer element they share with other Flag fields, but also their position in that shared field.

Flag fields operate mostly like a bool field, but they do not support reference access, and internally they are packed into an integer shared by multiple fields so the marginal cost of each Flag field is only one bit.

Definition at line 94 of file Flag.h.

Member Typedef Documentation

◆ ConstReference

using lsst::afw::table::FieldBase< Flag >::ConstReference

the type returned by BaseRecord::operator[] (const)

Definition at line 44 of file FieldBase.h.

◆ Element

using lsst::afw::table::FieldBase< Flag >::Element

the type of subfields (the same as the type itself for scalars)

Definition at line 45 of file FieldBase.h.

◆ Reference

using lsst::afw::table::FieldBase< Flag >::Reference

the type returned by BaseRecord::operator[] (non-const)

Definition at line 43 of file FieldBase.h.

◆ Value

using lsst::afw::table::FieldBase< Flag >::Value

the type returned by BaseRecord::get

Definition at line 42 of file FieldBase.h.

Constructor & Destructor Documentation

◆ Key() [1/6]

lsst::afw::table::Key< Flag >::Key ( )
inline

Default construct a field.

The new field will be invalid until a valid Key is assigned to it.

Definition at line 146 of file Flag.h.

◆ Key() [2/6]

lsst::afw::table::Key< Flag >::Key ( Key< Flag > const & )
default

◆ Key() [3/6]

lsst::afw::table::Key< Flag >::Key ( Key< Flag > && )
default

◆ ~Key() [1/2]

lsst::afw::table::Key< Flag >::~Key ( )
default

◆ Key() [4/6]

lsst::afw::table::Key< Flag >::Key ( )
inlinenoexcept

Default construct a field.

The new field will be invalid until a valid Key is assigned to it.

Definition at line 104 of file Key.h.

◆ Key() [5/6]

lsst::afw::table::Key< Flag >::Key ( Key< Flag > const & )
defaultnoexcept

◆ Key() [6/6]

lsst::afw::table::Key< Flag >::Key ( Key< Flag > && )
defaultnoexcept

◆ ~Key() [2/2]

lsst::afw::table::Key< Flag >::~Key ( )
defaultnoexcept

Member Function Documentation

◆ getBit()

std::size_t lsst::afw::table::Key< Flag >::getBit ( ) const
inline

The index of this field's bit within the integer it shares with other Flag fields.

Definition at line 129 of file Flag.h.

◆ getConstReference() [1/2]

ConstReference lsst::afw::table::FieldBase< Flag >::getConstReference ( Element const * p,
ndarray::Manager::Ptr const &  ) const
inlineprotectedinherited

Used to implement BaseRecord::operator[] (const).

Definition at line 78 of file FieldBase.h.

◆ getConstReference() [2/2]

ConstReference lsst::afw::table::FieldBase< Flag >::getConstReference ( Element const * p,
ndarray::Manager::Ptr const &  ) const
inlineprotected

Used to implement BaseRecord::operator[] (const).

Definition at line 78 of file FieldBase.h.

◆ getElementCount()

std::size_t lsst::afw::table::FieldBase< Flag >::getElementCount ( ) const
inlinenoexcept

Return the number of subfield elements (always one for scalars).

Definition at line 48 of file FieldBase.h.

◆ getOffset() [1/2]

std::size_t lsst::afw::table::Key< Flag >::getOffset ( ) const
inline

Return the offset in bytes of the integer element that holds this field's bit.

Definition at line 126 of file Flag.h.

◆ getOffset() [2/2]

std::size_t lsst::afw::table::Key< Flag >::getOffset ( ) const
inlinenoexcept

Return the offset (in bytes) of this field within a record.

Definition at line 87 of file Key.h.

◆ getReference() [1/2]

Reference lsst::afw::table::FieldBase< Flag >::getReference ( Element * p,
ndarray::Manager::Ptr const &  ) const
inlineprotectedinherited

Used to implement BaseRecord::operator[] (non-const).

Definition at line 75 of file FieldBase.h.

◆ getReference() [2/2]

Reference lsst::afw::table::FieldBase< Flag >::getReference ( Element * p,
ndarray::Manager::Ptr const &  ) const
inlineprotected

Used to implement BaseRecord::operator[] (non-const).

Definition at line 75 of file FieldBase.h.

◆ getStorage()

Key< FieldBase< Flag >::Element > lsst::afw::table::KeyBase< Flag >::getStorage ( ) const
inherited

Return a key corresponding to the integer element where this field's bit is packed.

Definition at line 15 of file KeyBase.cc.

◆ getTypeString()

std::string lsst::afw::table::FieldBase< Flag >::getTypeString ( )
static

Return a string description of the field type.

Definition at line 51 of file FieldBase.cc.

◆ getValue() [1/2]

Value lsst::afw::table::FieldBase< Flag >::getValue ( Element const * p,
ndarray::Manager::Ptr const &  ) const
inlineprotectedinherited

Used to implement BaseRecord::get.

Definition at line 81 of file FieldBase.h.

◆ getValue() [2/2]

Value lsst::afw::table::FieldBase< Flag >::getValue ( Element const * p,
ndarray::Manager::Ptr const &  ) const
inlineprotected

Used to implement BaseRecord::get.

Definition at line 81 of file FieldBase.h.

◆ hash_value() [1/2]

std::size_t lsst::afw::table::Key< Flag >::hash_value ( ) const
inlinenoexcept

Return a hash of this object.

Definition at line 120 of file Flag.h.

◆ hash_value() [2/2]

std::size_t lsst::afw::table::Key< Flag >::hash_value ( ) const
inlinenoexcept

Return a hash of this object.

Definition at line 81 of file Key.h.

◆ isValid() [1/2]

bool lsst::afw::table::Key< Flag >::isValid ( ) const
inline

Return true if the key was initialized to valid offset.

This does not guarantee that a key is valid with any particular schema, or even that any schemas still exist in which this key is valid.

A key that is default constructed will always be invalid.

Definition at line 139 of file Flag.h.

◆ isValid() [2/2]

bool lsst::afw::table::Key< Flag >::isValid ( ) const
inlinenoexcept

Return true if the key was initialized to valid offset.

This does not guarantee that a key is valid with any particular schema, or even that any schemas still exist in which this key is valid.

A key that is default constructed will always be invalid.

Definition at line 97 of file Key.h.

◆ makeDefault()

static FieldBase lsst::afw::table::FieldBase< Flag >::makeDefault ( )
inlinestaticprotectednoexcept

Needed to allow Keys to be default-constructed.

Definition at line 69 of file FieldBase.h.

◆ operator!=() [1/4]

bool lsst::afw::table::Key< Flag >::operator!= ( Key< Flag > const & other) const
inline

Definition at line 116 of file Flag.h.

◆ operator!=() [2/4]

bool lsst::afw::table::Key< Flag >::operator!= ( Key< Flag > const & other) const
inlinenoexcept

Definition at line 77 of file Key.h.

◆ operator!=() [3/4]

template<typename OtherT>
bool lsst::afw::table::Key< Flag >::operator!= ( Key< OtherT > const & other) const
inline

Definition at line 111 of file Flag.h.

◆ operator!=() [4/4]

bool lsst::afw::table::Key< Flag >::operator!= ( Key< OtherT > const & other) const
inlinenoexcept

Definition at line 70 of file Key.h.

◆ operator=() [1/4]

Key & lsst::afw::table::Key< Flag >::operator= ( Key< Flag > && )
defaultnoexcept

◆ operator=() [2/4]

Key & lsst::afw::table::Key< Flag >::operator= ( Key< Flag > && )
default

◆ operator=() [3/4]

Key & lsst::afw::table::Key< Flag >::operator= ( Key< Flag > const & )
defaultnoexcept

◆ operator=() [4/4]

Key & lsst::afw::table::Key< Flag >::operator= ( Key< Flag > const & )
default

◆ operator==() [1/4]

bool lsst::afw::table::Key< Flag >::operator== ( Key< Flag > const & other) const
inline

Definition at line 115 of file Flag.h.

◆ operator==() [2/4]

bool lsst::afw::table::Key< Flag >::operator== ( Key< Flag > const & other) const
inlinenoexcept

Definition at line 74 of file Key.h.

◆ operator==() [3/4]

template<typename OtherT>
bool lsst::afw::table::Key< Flag >::operator== ( Key< OtherT > const & other) const
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).

Definition at line 107 of file Flag.h.

◆ operator==() [4/4]

bool lsst::afw::table::Key< Flag >::operator== ( Key< OtherT > const & other) const
inlinenoexcept

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).

Definition at line 66 of file Key.h.

◆ setValue() [1/2]

void lsst::afw::table::FieldBase< Flag >::setValue ( Element * p,
ndarray::Manager::Ptr const & ,
Value v ) const
inlineprotectedinherited

Used to implement BaseRecord::set.

Definition at line 84 of file FieldBase.h.

◆ setValue() [2/2]

void lsst::afw::table::FieldBase< Flag >::setValue ( Element * p,
ndarray::Manager::Ptr const & ,
Value v ) const
inlineprotected

Used to implement BaseRecord::set.

Definition at line 84 of file FieldBase.h.

◆ stream()

void lsst::afw::table::FieldBase< Flag >::stream ( std::ostream & os) const
inlineprotected

Defines how Fields are printed.

Definition at line 72 of file FieldBase.h.

Friends And Related Symbol Documentation

◆ BaseRecord [1/2]

friend class BaseRecord
friend

Definition at line 162 of file Flag.h.

◆ BaseRecord [2/2]

friend class BaseRecord
friend

Definition at line 120 of file Key.h.

◆ detail::Access [1/2]

friend class detail::Access
friend

Definition at line 161 of file Flag.h.

◆ detail::Access [2/2]

friend class detail::Access
friend

Definition at line 119 of file Key.h.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & os,
Key< Flag > const & key )
friend

Stringification.

Definition at line 155 of file Flag.h.

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream & os,
Key< Flag > const & key )
friend

Stringification.

Definition at line 113 of file Key.h.

Member Data Documentation

◆ HAS_NAMED_SUBFIELDS

bool const lsst::afw::table::KeyBase< Flag >::HAS_NAMED_SUBFIELDS
static

Definition at line 22 of file KeyBase.h.


The documentation for this class was generated from the following file: