#include <CalibTracker/SiStripRunSummary/interface/Flag.h>
Public Types | |
enum | State { UNKNOWN = 0, ERROR = 1, OK = 2 } |
Available Flags states. More... | |
Public Member Functions | |
Flag () | |
std::string | getComment () const |
Retrieve Flags comment. | |
State | getState () const |
Retrieve Flags current state. | |
void | setComment (const std::string &roCOMMENT) |
Set flag comment. | |
virtual bool | setState (const State &reSTATE) |
Leave chance to override setState method to add option of updating parent value based on child change. | |
virtual | ~Flag () |
Protected Member Functions | |
Flag (const Flag &roFLAG) | |
Allow only children to copy Flags. | |
Protected Attributes | |
State | eState_ |
Unfortunately all properties of Flag (that are going to be serialized) have to be protected. | |
std::string | oComment_ |
Private Member Functions | |
Flag & | operator= (const Flag &rnFLAG) |
Prevent copying Flags via assignment. |
Current Flag state 2. Flag comment
Definition at line 20 of file Flag.h.
enum Flag::State |
Flag::Flag | ( | ) | [inline] |
Flag::Flag | ( | const Flag & | roFLAG | ) | [inline, protected] |
std::string Flag::getComment | ( | ) | const [inline] |
Retrieve Flags comment.
Definition at line 77 of file Flag.h.
References oComment_.
Referenced by operator<<().
00077 { return oComment_; }
State Flag::getState | ( | ) | const [inline] |
Retrieve Flags current state.
Definition at line 68 of file Flag.h.
References eState_.
Referenced by FlagXML::createChild(), FlagTxt::createChild(), and operator<<().
00068 { return eState_; }
Prevent copying Flags via assignment.
rnFLAG | Flag to be copied |
void Flag::setComment | ( | const std::string & | roCOMMENT | ) | [inline] |
Set flag comment.
roCOMMENT | New comment to be set [any previous comment will be replaced] |
Definition at line 57 of file Flag.h.
References oComment_.
Referenced by getTXTFlagTree(), getXMLFlagTree(), and setFlag().
00057 { 00058 oComment_ = roCOMMENT; 00059 }
Leave chance to override setState method to add option of updating parent value based on child change.
Should be implemented by children that hold containers of sub-flags.
reSTATE | New State of flag to be set |
Reimplemented in FlagTxt, and FlagXML.
Definition at line 11 of file Flag.cc.
References eState_.
Referenced by setFlag(), FlagXML::setState(), and FlagTxt::setState().
00011 { 00012 // 1. reSTATE may be any value of: 0, 1, 2, 3...(2^n-1) where n is the nearest 00013 // larger binary power. 00014 // 00015 // oHackObj.setState( Flag::State( 3)); 00016 // 00017 // 2. Change state of flag only in case a new value was submitted 00018 return ( 3 > static_cast<unsigned char>( reSTATE) && 00019 reSTATE != eState_ ? 00020 ( eState_ = reSTATE, true) : 00021 false); 00022 }
State Flag::eState_ [protected] |
Unfortunately all properties of Flag (that are going to be serialized) have to be protected.
Otherwise Serialization won't work :(.
Definition at line 96 of file Flag.h.
Referenced by getState(), FlagTxt::load(), FlagXML::load(), FlagTxt::save(), FlagXML::save(), setState(), FlagTxt::updateState(), and FlagXML::updateState().
std::string Flag::oComment_ [protected] |
Definition at line 97 of file Flag.h.
Referenced by getComment(), FlagTxt::load(), FlagXML::load(), FlagTxt::save(), FlagXML::save(), and setComment().