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())
39 return _vector[index];
61 r.failureFlagNumber =
i;
void set(Key< T > const &key, U const &value)
vector-type utility class to build a collection of FlagDefinitions
FlagDefinition add(std::string const &name, std::string const &doc)
Add a new FlagDefinition to this list.
FlagDefinition getDefinition(std::size_t index) const
get a reference to the FlagDefinition with specified index.
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 ...
Utility class for handling flag fields that indicate the failure modes of an algorithm.
std::size_t failureFlagNumber
void handleFailure(afw::table::BaseRecord &record, MeasurementError const *error=nullptr) const
Handle an expected or unexpected Exception thrown by a measurement algorithm.
FlagHandler()
Each error should have a corresponding static FlagDefinition object.
static FlagHandler addFields(afw::table::Schema &schema, std::string const &prefix, FlagDefinitionList const &flagDefs, FlagDefinitionList const &exclDefs=FlagDefinitionList::getEmptyList())
Add Flag fields to a schema, creating a FlagHandler object to manage them.
static std::string const & getFailureFlagName()
Define the universal name of the general failure flag.
Exception to be thrown when a measurement algorithm experiences a known failure mode.
std::size_t getFlagBit() const
Return the flag bit associated with the error.
Simple class used to define and document flags The name and doc constitute the identity of the FlagDe...
static constexpr std::size_t number_undefined