LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
lsst::meas::base::FlagHandler Class Reference

#include <FlagHandler.h>

Public Types

enum  { FAILURE =0 }
 

Public Member Functions

 FlagHandler ()
 
 FlagHandler (afw::table::SubSchema const &s, FlagDefinition const *begin, FlagDefinition const *end)
 
FlagDefinition getDefinition (int i) const
 
bool getValue (afw::table::BaseRecord const &record, int i) const
 
void setValue (afw::table::BaseRecord &record, int i, bool value) const
 
void handleFailure (afw::table::BaseRecord &record, MeasurementError const *error=NULL) const
 

Static Public Member Functions

static FlagHandler addFields (afw::table::Schema &schema, std::string const &prefix, FlagDefinition const *begin, FlagDefinition const *end)
 

Private Types

typedef std::vector< std::pair
< FlagDefinition,
afw::table::Key
< afw::table::Flag > > > 
Vector
 

Private Attributes

Vector _vector
 

Detailed Description

Definition at line 46 of file FlagHandler.h.

Member Typedef Documentation

typedef std::vector< std::pair<FlagDefinition, afw::table::Key<afw::table::Flag> > > lsst::meas::base::FlagHandler::Vector
private

Definition at line 80 of file FlagHandler.h.

Member Enumeration Documentation

anonymous enum
Enumerator
FAILURE 

Definition at line 49 of file FlagHandler.h.

Constructor & Destructor Documentation

lsst::meas::base::FlagHandler::FlagHandler ( )
inline

Definition at line 51 of file FlagHandler.h.

51 {}
lsst::meas::base::FlagHandler::FlagHandler ( afw::table::SubSchema const &  s,
FlagDefinition const *  begin,
FlagDefinition const *  end 
)

Definition at line 47 of file FlagHandler.cc.

51  {
52  _vector.reserve(end - begin);
53  for (FlagDefinition const * iter = begin; iter != end; ++iter) {
54  afw::table::Key<afw::table::Flag> key = s[iter->name];
55  _vector.push_back(std::make_pair(*iter, key));
56  }
57 }
int iter

Member Function Documentation

FlagHandler lsst::meas::base::FlagHandler::addFields ( afw::table::Schema schema,
std::string const &  prefix,
FlagDefinition const *  begin,
FlagDefinition const *  end 
)
static

Definition at line 28 of file FlagHandler.cc.

33  {
34  FlagHandler r;
35  r._vector.reserve(end - begin);
36  for (FlagDefinition const * iter = begin; iter != end; ++iter) {
37  r._vector.push_back(
38  std::make_pair(
39  *iter,
40  schema.addField<afw::table::Flag>(schema.join(prefix, iter->name), iter->doc)
41  )
42  );
43  }
44  return r;
45 }
int iter
tbl::Schema schema
FlagDefinition lsst::meas::base::FlagHandler::getDefinition ( int  i) const
inline

Definition at line 66 of file FlagHandler.h.

66 { return _vector[i].first; }
bool lsst::meas::base::FlagHandler::getValue ( afw::table::BaseRecord const &  record,
int  i 
) const
inline

Definition at line 68 of file FlagHandler.h.

68  {
69  return record.get(_vector[i].second);
70  }
void lsst::meas::base::FlagHandler::handleFailure ( afw::table::BaseRecord record,
MeasurementError const *  error = NULL 
) const

Definition at line 59 of file FlagHandler.cc.

59  {
60  record.set(_vector[0].second, true);
61  if (error) {
62  record.set(_vector[error->getFlagBit()].second, true);
63  }
64 }
def error
Definition: log.py:108
void lsst::meas::base::FlagHandler::setValue ( afw::table::BaseRecord record,
int  i,
bool  value 
) const
inline

Definition at line 72 of file FlagHandler.h.

72  {
73  record.set(_vector[i].second, value);
74  }

Member Data Documentation

Vector lsst::meas::base::FlagHandler::_vector
private

Definition at line 82 of file FlagHandler.h.


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