lsst.afw  14.0-40-g0271be365
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
lsst::afw::table::Key< Flag > Class Template 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 >

Public Types

typedef bool Value
 the type returned by BaseRecord::get More...
 
typedef std::int64_t Element
 the actual storage type (shared by multiple flag fields) More...
 

Public Member Functions

int getOffset () const
 Return the offset in bytes of the integer element that holds this field's bit. More...
 
int getBit () const
 The index of this field's bit within the integer it shares with other Flag fields. More...
 
bool isValid () const
 Return true if the key was initialized to valid offset. More...
 
 Key ()
 Default construct a field. More...
 
Key< FieldBase< Flag >::Element > getStorage () const
 Return a key corresponding to the integer element where this field's bit is packed. 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...
 

Friends

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

Detailed Description

template<>
class lsst::afw::table::Key< Flag >

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 79 of file Flag.h.

Member Typedef Documentation

◆ Element

typedef std::int64_t lsst::afw::table::FieldBase< Flag >::Element
inherited

the actual storage type (shared by multiple flag fields)

Definition at line 33 of file Flag.h.

◆ Value

typedef bool lsst::afw::table::FieldBase< Flag >::Value
inherited

the type returned by BaseRecord::get

Definition at line 32 of file Flag.h.

Constructor & Destructor Documentation

◆ Key()

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 125 of file Flag.h.

Member Function Documentation

◆ getBit()

int 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 108 of file Flag.h.

◆ getElementCount()

int lsst::afw::table::FieldBase< Flag >::getElementCount ( ) const
inlineinherited

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

Definition at line 36 of file Flag.h.

◆ getOffset()

int 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 105 of file Flag.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.

◆ getTypeString()

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

Return a string description of the field type.

Definition at line 39 of file Flag.h.

◆ isValid()

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 118 of file Flag.h.

◆ operator!=() [1/2]

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 96 of file Flag.h.

◆ operator!=() [2/2]

bool lsst::afw::table::Key< Flag >::operator!= ( Key< Flag > 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 101 of file Flag.h.

◆ operator==() [1/2]

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 92 of file Flag.h.

◆ operator==() [2/2]

bool lsst::afw::table::Key< Flag >::operator== ( Key< Flag > 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 100 of file Flag.h.

◆ stream()

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

Defines how fields are printed.

Definition at line 52 of file Flag.h.

Friends And Related Function Documentation

◆ BaseRecord

friend class BaseRecord
friend

Definition at line 135 of file Flag.h.

◆ detail::Access

friend class detail::Access
friend

Definition at line 134 of file Flag.h.

◆ operator<<

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

Stringification.

Definition at line 128 of file Flag.h.

Member Data Documentation

◆ HAS_NAMED_SUBFIELDS

bool const lsst::afw::table::KeyBase< Flag >::HAS_NAMED_SUBFIELDS = false
staticinherited

Definition at line 61 of file Flag.h.


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