LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | Friends | List of all members
lsst::afw::table::BitsColumn Class Referencefinal

A packed representation of a collection of Flag field columns. More...

#include <BaseColumnView.h>

Public Types

using SizeT = std::size_t
 

Public Member Functions

ndarray::Array< SizeT, 1, 1 > getArray () const
 
SizeT getBit (Key< Flag > const &key) const
 
SizeT getBit (std::string const &name) const
 
SizeT getMask (Key< Flag > const &key) const
 
SizeT getMask (std::string const &name) const
 
std::vector< SchemaItem< Flag > > const & getSchemaItems () const
 

Friends

class BaseColumnView
 

Detailed Description

A packed representation of a collection of Flag field columns.

The packing of bits here is not necessarily the same as the packing using in the actual table, as the latter may contain more than 64 bits spread across multiple integers.

A BitsColumn can only be constructed by calling BaseColumnView::getBits().

Definition at line 42 of file BaseColumnView.h.

Member Typedef Documentation

◆ SizeT

Definition at line 44 of file BaseColumnView.h.

Member Function Documentation

◆ getArray()

ndarray::Array<SizeT, 1, 1> lsst::afw::table::BitsColumn::getArray ( ) const
inline

Definition at line 46 of file BaseColumnView.h.

46 { return _array; }

◆ getBit() [1/2]

BitsColumn::SizeT lsst::afw::table::BitsColumn::getBit ( Key< Flag > const &  key) const

Definition at line 33 of file BaseColumnView.cc.

33  {
34  SizeT r = std::find_if(_items.begin(), _items.end(), MatchKey(key)) - _items.begin();
35  if (std::size_t(r) == _items.size()) {
36  throw LSST_EXCEPT(pex::exceptions::NotFoundError,
37  (boost::format("'%s' not found in BitsColumn") % key).str());
38  }
39  return r;
40 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
T find_if(T... args)
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:174

◆ getBit() [2/2]

BitsColumn::SizeT lsst::afw::table::BitsColumn::getBit ( std::string const &  name) const

Definition at line 42 of file BaseColumnView.cc.

42  {
43  SizeT r = std::find_if(_items.begin(), _items.end(), MatchName(name)) - _items.begin();
44  if (std::size_t(r) == _items.size()) {
45  throw LSST_EXCEPT(pex::exceptions::NotFoundError,
46  (boost::format("'%s' not found in BitsColumn") % name).str());
47  }
48  return r;
49 }
table::Key< std::string > name
Definition: Amplifier.cc:116

◆ getMask() [1/2]

SizeT lsst::afw::table::BitsColumn::getMask ( Key< Flag > const &  key) const
inline

Definition at line 51 of file BaseColumnView.h.

51 { return SizeT(1) << getBit(key); }
SizeT getBit(Key< Flag > const &key) const

◆ getMask() [2/2]

SizeT lsst::afw::table::BitsColumn::getMask ( std::string const &  name) const
inline

Definition at line 52 of file BaseColumnView.h.

52 { return SizeT(1) << getBit(name); }

◆ getSchemaItems()

std::vector<SchemaItem<Flag> > const& lsst::afw::table::BitsColumn::getSchemaItems ( ) const
inline

Definition at line 54 of file BaseColumnView.h.

54 { return _items; }

Friends And Related Function Documentation

◆ BaseColumnView

friend class BaseColumnView
friend

Definition at line 57 of file BaseColumnView.h.


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