CMS 3D CMS Logo

Flag Class Reference

Flag Base container that holds such values as: 1. More...

#include <CalibTracker/SiStripRunSummary/interface/Flag.h>

Inheritance diagram for Flag:

Clonable Identifiable FlagTxt FlagXML DAQFlagTxt DCSFlagTxt DQMFlagTxt GlobalFlagTxt TECFlagTxt TIBFlagTxt TIDFlagTxt TOBFlagTxt TriggerFlagTxt DAQFlagXML DCSFlagXML DQMFlagXML GlobalFlagXML TECFlagXML TIBFlagXML TIDFlagXML TOBFlagXML TriggerFlagXML

List of all members.

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

Flagoperator= (const Flag &rnFLAG)
 Prevent copying Flags via assignment.


Detailed Description

Flag Base container that holds such values as: 1.

Current Flag state 2. Flag comment

Definition at line 20 of file Flag.h.


Member Enumeration Documentation

enum Flag::State

Available Flags states.

Enumerator:
UNKNOWN 
ERROR 
OK 

Definition at line 28 of file Flag.h.

00028                { UNKNOWN = 0, 
00029                  ERROR   = 1, 
00030                  OK      = 2 };


Constructor & Destructor Documentation

Flag::Flag (  )  [inline]

Definition at line 32 of file Flag.h.

00032 : eState_( UNKNOWN), oComment_( "") {}

virtual Flag::~Flag (  )  [inline, virtual]

Definition at line 33 of file Flag.h.

00033 {}

Flag::Flag ( const Flag roFLAG  )  [inline, protected]

Allow only children to copy Flags.

Method is needed for base construction.

Parameters:
roFLAG Flag to be copied.

Definition at line 87 of file Flag.h.

00088       : eState_  ( roFLAG.eState_),
00089         oComment_( roFLAG.oComment_) {}


Member Function Documentation

std::string Flag::getComment (  )  const [inline]

Retrieve Flags comment.

Returns:
std::string Representing 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.

Returns:
Flag::State

Definition at line 68 of file Flag.h.

References eState_.

Referenced by FlagXML::createChild(), FlagTxt::createChild(), and operator<<().

00068 { return eState_; }

Flag& Flag::operator= ( const Flag rnFLAG  )  [private]

Prevent copying Flags via assignment.

Parameters:
rnFLAG Flag to be copied
Returns:
Reference to current flag

void Flag::setComment ( const std::string &  roCOMMENT  )  [inline]

Set flag comment.

Parameters:
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     }

bool Flag::setState ( const State reSTATE  )  [virtual]

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.

Parameters:
reSTATE New State of flag to be set
Returns:
true If flag state changed [it will change only in case new value differs from current one] false Otherwise

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 }


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:20:56 2009 for CMSSW by  doxygen 1.5.4