LSST Applications g034a557a3c+dd8dd8f11d,g0afe43252f+b86e4b8053,g11f7dcd041+017865fdd3,g1cd03abf6b+8446defddb,g1ce3e0751c+f991eae79d,g28da252d5a+ca8a1a9fb3,g2bbee38e9b+b6588ad223,g2bc492864f+b6588ad223,g2cdde0e794+8523d0dbb4,g347aa1857d+b6588ad223,g35bb328faa+b86e4b8053,g3a166c0a6a+b6588ad223,g461a3dce89+b86e4b8053,g52b1c1532d+b86e4b8053,g7f3b0d46df+ad13c1b82d,g80478fca09+f29c5d6c70,g858d7b2824+293f439f82,g8cd86fa7b1+af721d2595,g965a9036f2+293f439f82,g979bb04a14+51ed57f74c,g9ddcbc5298+f24b38b85a,gae0086650b+b86e4b8053,gbb886bcc26+b97e247655,gc28159a63d+b6588ad223,gc30aee3386+a2f0f6cab9,gcaf7e4fdec+293f439f82,gcd45df26be+293f439f82,gcdd4ae20e8+70b5def7e6,gce08ada175+da9c58a417,gcf0d15dbbd+70b5def7e6,gdaeeff99f8+006e14e809,gdbce86181e+6a170ce272,ge3d4d395c2+224150c836,ge5f7162a3a+bb2241c923,ge6cb8fbbf7+d119aed356,ge79ae78c31+b6588ad223,gf048a9a2f4+40ffced2b8,gf0baf85859+b4cca3d10f,w.2024.30
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
lsst::meas::base::FlagDefinitionList Class Reference

vector-type utility class to build a collection of FlagDefinitions More...

#include <FlagHandler.h>

Public Member Functions

 FlagDefinitionList ()
 initialize a FlagDefinition list with no entries.
 
 FlagDefinitionList (std::initializer_list< FlagDefinition > const &list)
 initialize a FlagDefinition list from initializer_list.
 
FlagDefinition getDefinition (std::size_t index) const
 get a reference to the FlagDefinition with specified index.
 
FlagDefinition getDefinition (std::string const &name) const
 get a reference to the FlagDefinition with specified name.
 
FlagDefinition operator[] (std::size_t index) const
 get a reference to the FlagDefinition with specified array index
 
bool hasDefinition (std::string const &name) const
 See if there is a FlagDefinition with specified name.
 
FlagDefinition addFailureFlag (std::string const &doc="General Failure Flag")
 Add a Flag Defintion to act as a "General" failure flag This flag will be set if a Measurement error is thrown.
 
FlagDefinition add (std::string const &name, std::string const &doc)
 Add a new FlagDefinition to this list.
 
std::size_t size () const
 return the current size (number of defined elements) of the collection
 

Static Public Member Functions

static FlagDefinitionList const & getEmptyList ()
 

Detailed Description

vector-type utility class to build a collection of FlagDefinitions

Definition at line 60 of file FlagHandler.h.

Constructor & Destructor Documentation

◆ FlagDefinitionList() [1/2]

lsst::meas::base::FlagDefinitionList::FlagDefinitionList ( )
inline

initialize a FlagDefinition list with no entries.

Definition at line 65 of file FlagHandler.h.

65{};

◆ FlagDefinitionList() [2/2]

lsst::meas::base::FlagDefinitionList::FlagDefinitionList ( std::initializer_list< FlagDefinition > const & list)
inline

initialize a FlagDefinition list from initializer_list.

Definition at line 70 of file FlagHandler.h.

70 {
71 for (FlagDefinition const* iter = list.begin(); iter < list.end(); iter++) {
72 add(iter->name, iter->doc);
73 }
74 }
FlagDefinition add(std::string const &name, std::string const &doc)
Add a new FlagDefinition to this list.

Member Function Documentation

◆ add()

FlagDefinition lsst::meas::base::FlagDefinitionList::add ( std::string const & name,
std::string const & doc )
inline

Add a new FlagDefinition to this list.

Return a copy with the FlagDefinition.number set corresponding to its index in the list.

Definition at line 117 of file FlagHandler.h.

117 {
118 FlagDefinition flagDef = FlagDefinition(name, doc, _vector.size());
119 _vector.push_back(flagDef);
120 return _vector.back();
121 }

◆ addFailureFlag()

FlagDefinition lsst::meas::base::FlagDefinitionList::addFailureFlag ( std::string const & doc = "General Failure Flag")

Add a Flag Defintion to act as a "General" failure flag This flag will be set if a Measurement error is thrown.

Definition at line 43 of file FlagHandler.cc.

43 {
45}
static std::string const & getFailureFlagName()
Define the universal name of the general failure flag.

◆ getDefinition() [1/2]

FlagDefinition lsst::meas::base::FlagDefinitionList::getDefinition ( std::size_t index) const

get a reference to the FlagDefinition with specified index.

Definition at line 33 of file FlagHandler.cc.

33 {
34 if (index >= _vector.size()) {
35 throw std::out_of_range((boost::format("Cannot access index %d of length=%d flag definition list.") %
36 index % _vector.size())
37 .str());
38 } else {
39 return _vector[index];
40 }
41}

◆ getDefinition() [2/2]

FlagDefinition lsst::meas::base::FlagDefinitionList::getDefinition ( std::string const & name) const
inline

get a reference to the FlagDefinition with specified name.

Definition at line 88 of file FlagHandler.h.

88 {
89 for (std::size_t i = 0; i < size(); i++) {
90 if (_vector[i].name == name) return _vector[i];
91 }
92 throw FatalAlgorithmError("No Flag Definition for " + name);
93 }
std::size_t size() const
return the current size (number of defined elements) of the collection

◆ getEmptyList()

static FlagDefinitionList const & lsst::meas::base::FlagDefinitionList::getEmptyList ( )
inlinestatic

Definition at line 76 of file FlagHandler.h.

76 {
77 static FlagDefinitionList list;
78 return list;
79 }
daf::base::PropertyList * list
Definition fits.cc:932

◆ hasDefinition()

bool lsst::meas::base::FlagDefinitionList::hasDefinition ( std::string const & name) const
inline

See if there is a FlagDefinition with specified name.

Definition at line 101 of file FlagHandler.h.

101 {
102 for (std::size_t i = 0; i < size(); i++) {
103 if (_vector[i].name == name) return true;
104 }
105 return false;
106 }

◆ operator[]()

FlagDefinition lsst::meas::base::FlagDefinitionList::operator[] ( std::size_t index) const
inline

get a reference to the FlagDefinition with specified array index

Definition at line 97 of file FlagHandler.h.

97{ return getDefinition(index); }
FlagDefinition getDefinition(std::size_t index) const
get a reference to the FlagDefinition with specified index.

◆ size()

std::size_t lsst::meas::base::FlagDefinitionList::size ( ) const
inline

return the current size (number of defined elements) of the collection

Definition at line 126 of file FlagHandler.h.

126{ return _vector.size(); }

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