LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | List of all members
lsst::meas::base::MeasurementError Class Reference

Exception to be thrown when a measurement algorithm experiences a known failure mode. More...

#include <exceptions.h>

Inheritance diagram for lsst::meas::base::MeasurementError:

Public Member Functions

 MeasurementError (std::string const &message, std::size_t flagBit)
 Constructor; should only be invoked from Python macro. More...
 
 MeasurementError (LSST_EARGS_TYPED, std::size_t flagBit)
 Constructor; should only be invoked by the LSST_EXCEPT macro (see class docs) More...
 
std::size_t getFlagBit () const
 Return the flag bit associated with the error. More...
 
virtual char const * getType (void) const throw ()
 
virtual
lsst::pex::exceptions::Exception
clone (void) const
 

Private Attributes

std::size_t _flagBit
 

Detailed Description

Exception to be thrown when a measurement algorithm experiences a known failure mode.

In addition to the usual message, MeasurementError must be constructed with the bit of the algorithm-specific flag that indicates the known failure mode. This allows the measurement framework to set that flag upon failure. Typically, this flag bit is also used to look up the message from the algorithm classes FlagDefinition list; the common pattern is:

* if (badThingHappened) {
* // BAD_THING is an enum value from the Algorithm's FlagBits enum; getFlagDefinitions()
* // is a static method algorithms are expected to define.
* throw LSST_EXCEPT(MeasurementError, getFlagDefinitions()[BAD_THING), BAD_THING);
* }
*

Definition at line 48 of file exceptions.h.

Constructor & Destructor Documentation

lsst::meas::base::MeasurementError::MeasurementError ( std::string const &  message,
std::size_t  flagBit 
)
inline

Constructor; should only be invoked from Python macro.

Definition at line 52 of file exceptions.h.

52  :
53  pex::exceptions::RuntimeError(message),
54  _flagBit(flagBit)
55  {}
lsst::meas::base::MeasurementError::MeasurementError ( LSST_EARGS_TYPED  ,
std::size_t  flagBit 
)
inline

Constructor; should only be invoked by the LSST_EXCEPT macro (see class docs)

Definition at line 58 of file exceptions.h.

58  :
59  pex::exceptions::RuntimeError(LSST_EARGS_UNTYPED),
60  _flagBit(flagBit)
61  {}
#define LSST_EARGS_UNTYPED
Definition: Exception.h:61

Member Function Documentation

virtual lsst::pex::exceptions::Exception* lsst::meas::base::MeasurementError::clone ( void  ) const
inlinevirtual

Definition at line 68 of file exceptions.h.

68  {
69  return new MeasurementError(*this);
70  };
MeasurementError(std::string const &message, std::size_t flagBit)
Constructor; should only be invoked from Python macro.
Definition: exceptions.h:52
std::size_t lsst::meas::base::MeasurementError::getFlagBit ( ) const
inline

Return the flag bit associated with the error.

Definition at line 64 of file exceptions.h.

64 { return _flagBit; }
virtual char const* lsst::meas::base::MeasurementError::getType ( void  ) const
throw (
)
inlinevirtual

Definition at line 66 of file exceptions.h.

66 { return "lsst::meas::base::MeasurementError *"; };

Member Data Documentation

std::size_t lsst::meas::base::MeasurementError::_flagBit
private

Definition at line 70 of file exceptions.h.


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