|
Boolean flags Attribute.
More...
#include <cfl_attributes.h>
Public Member Functions |
| AttributeFlags (void) |
| Default constructor.
|
| AttributeFlags (const AttributeFlags &rOther) |
| Copy constructor.
|
virtual | ~AttributeFlags (void) |
| Destructor.
|
bool | Test (fType mask) const |
| Test a flag.
|
bool | TestAll (fType mask) const |
| Test multible flags, combine by "and".
|
bool | TestSome (fType mask) const |
| Test multible flags, combine by "or".
|
bool | TestNone (fType mask) const |
| Test multible flags, combine by "not or".
|
void | Set (fType mask) |
| Set multiple flags.
|
void | Clr (fType mask) |
| Clear multiple flags.
|
virtual bool | IsDefault (void) const |
| Test for default value.
|
| AttributeVoid (void) |
| Constructor.
|
virtual | ~AttributeVoid (void) |
| Destructor.
|
virtual void | SetDefault (void) |
| Set to default value.
|
virtual void | Clear (void) |
| Synonym for SetDefault to match std interface.
|
| Type (void) |
| Constructor.
|
| Type (const Type &rType) |
| Copy constructor.
|
virtual | ~Type (void) |
| Destructor.
|
virtual Type * | New (void) const |
| Construct on heap.
|
virtual Type * | Copy (void) const |
| Construct on heap.
|
virtual const Type * | Cast (const Type *pOther) const |
| Cast other object to this type.
|
virtual Type & | Assign (const Type &rSrc) |
| Assign configuration data from other object.
|
virtual Type & | operator= (const Type &rSrc) |
| Assign configurationdata from other object.
|
virtual bool | Equal (const Type &rOther) const |
| Test equality of configuration data.
|
virtual bool | operator== (const Type &rOther) const |
| Test equality of configuration data.
|
virtual bool | operator!= (const Type &rOther) const |
| Test equality of configuration data.
|
virtual void | Name (const std::string &rName) |
| Set the objects's name.
|
virtual const std::string & | Name (void) const |
| Get objects's name.
|
void | Write (const Type *pContext=0) const |
| Write configuration data to console.
|
void | Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const |
| Write configuration data to a file.
|
void | Write (const std::string &pFileName, std::ios::openmode openmode) const |
| Write configuration data to a file.
|
void | Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to TokenWriter.
|
virtual void | XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to an XML file.
|
void | XWrite (const Type *pContext=0) const |
| Write configuration data in XML format to concole Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes.
|
void | XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data in XML format to TokenWriter.
|
std::string | ToString (const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to a string.
|
std::string | ToText (const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to a formated string.
|
void | DWrite (const Type *pContext=0) const |
| Write configuration data to console, debugging format.
|
void | DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const |
| Write configuration data to a file, debugging format.
|
void | DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data in debug format to TokenWriter.
|
void | SWrite (TokenWriter &rTw) const |
| Write statistics comment to TokenWriter.
|
void | SWrite (void) const |
| Write statistics comment to console.
|
std::string | ToSText (void) const |
| Write statistics to a string.
|
void | Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0) |
| Read configuration data from file with label specified.
|
void | FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0) |
| Read configuration data from a string.
|
void | Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
| Read configuration data from TokenReader with label sepcified.
|
Public Attributes |
fType | mFlags |
| Flags (public access for convenience)
|
Protected Member Functions |
void | DoAssign (const AttributeFlags &rSrcAttr) |
| Assignment method.
|
virtual bool | DoEqual (const AttributeFlags &rOther) const |
| Test equality of configuration data.
|
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
| Reads attribute from TokenReader, see Type for public wrappers.
|
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write to TokenWriter, see Type for public wrappers.
|
virtual void | DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write to TokenWriter, see Type for public wrappers.
|
virtual void | DoAssign (const AttributeVoid &rSrcAttr) |
| Assign attribute members.
|
virtual bool | DoEqual (const AttributeVoid &rOther) const |
| Test equality of configuration data.
|
virtual void | DoAssign (const Type &rSrc) |
| Assign configuration data from other object.
|
virtual bool | DoEqual (const Type &rOther) const |
| Test equality of configuration data.
|
virtual void | DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data in debugging format to TokenWriter.
|
virtual void | DoSWrite (TokenWriter &rTw) const |
| Write statistical data as a comment to TokenWriter.
|
virtual const TypeDefinition * | TypeDefinitionp (void) const |
| Get objects's type definition.
|
virtual const std::string & | TypeName (void) const |
| Get objects's type name.
|
virtual Token | XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const |
Additional Inherited Members |
static void | Skip (TokenReader &rTr) |
| Skip attribute tokens.
|
Detailed Description
Boolean flags Attribute.
This attribute class uses a flag word to represent boolean values. The current implementation uses a long int type and hence handles up to 32 flags. Each flag is accessed by the according bit mask.
The current version of libFAUDES uses bits 0,1,2 of event attributes for controllability properties (see AttributeCFlags) and the bits 31 and 32 of state attributes for the Qt based GUI project. Further versions may use the lower 8 bits of the event aflags and the higher 8 bits of state flags. You are free to use any flags for your application, but if possible try to avoid the above mentioned. For extensive use of flags, you may also consider to define a separate attribute class, perhaps with a different fType.
Definition at line 182 of file cfl_attributes.h.
Constructor & Destructor Documentation
faudes::AttributeFlags::AttributeFlags |
( |
void |
| ) |
|
|
inline |
faudes::AttributeFlags::AttributeFlags |
( |
const AttributeFlags & |
rOther | ) |
|
|
inline |
virtual faudes::AttributeFlags::~AttributeFlags |
( |
void |
| ) |
|
|
inlinevirtual |
Member Function Documentation
void faudes::AttributeFlags::Clr |
( |
fType |
mask | ) |
|
|
inline |
void faudes::AttributeFlags::DoAssign |
( |
const AttributeFlags & |
rSrcAttr | ) |
|
|
protected |
Assignment method.
- Parameters
-
rSrcAttr | Source to assign from |
Definition at line 99 of file cfl_attributes.cpp.
bool faudes::AttributeFlags::DoEqual |
( |
const AttributeFlags & |
rOther | ) |
const |
|
protectedvirtual |
Test equality of configuration data.
- Parameters
-
rOther | Other object to compare with. |
- Returns
- True on match.
Definition at line 107 of file cfl_attributes.cpp.
void faudes::AttributeFlags::DoRead |
( |
TokenReader & |
rTr, |
|
|
const std::string & |
rLabel = "" , |
|
|
const Type * |
pContext = 0 |
|
) |
| |
|
protectedvirtual |
Reads attribute from TokenReader, see Type for public wrappers.
Test whether the current token is an integer with base 16. If so, read the token to the flags value. Else, dont take any tokens. The label and context arguments are ignored.
- Parameters
-
rTr | TokenReader to read from |
rLabel | Section to read |
pContext | Read context to provide contextual information |
- Exceptions
-
Reimplemented from faudes::AttributeVoid.
Reimplemented in faudes::HioStateFlags, faudes::AttributeIosState, faudes::AttributeSimCondition, faudes::SimEventAttribute, faudes::DiagLabelSet, faudes::AttributeGotoState, faudes::HioEventFlags, faudes::AttributeCFlags, faudes::AttributeIosEvent, faudes::AttributeColoredState, faudes::AttributeTimedState, faudes::AttributeDiagnoserState, faudes::AttributeFailureTypeMap, faudes::AttributePushdownState, faudes::AttributeFailureEvents, and faudes::AttributeTimedTrans.
Definition at line 140 of file cfl_attributes.cpp.
void faudes::AttributeFlags::DoWrite |
( |
TokenWriter & |
rTw, |
|
|
const std::string & |
rLabel = "" , |
|
|
const Type * |
pContext = 0 |
|
) |
| const |
|
protectedvirtual |
Write to TokenWriter, see Type for public wrappers.
If not the defult value, write the flag value as base 16 integer token. Else, do nothing. The label and context arguments are ignored.
- Parameters
-
rTw | Reference to TokenWriter |
rLabel | Label of section to write |
pContext | Write context to provide contextual information |
- Exceptions
-
Reimplemented from faudes::AttributeVoid.
Reimplemented in faudes::HioStateFlags, faudes::AttributeIosState, faudes::AttributeSimCondition, faudes::SimEventAttribute, faudes::AttributeGotoState, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::AttributeCFlags, faudes::AttributeIosEvent, faudes::AttributeTimedState, faudes::AttributeColoredState, faudes::AttributePushdownState, faudes::AttributeDiagnoserState, faudes::AttributeFailureTypeMap, faudes::AttributeTimedTrans, and faudes::AttributeFailureEvents.
Definition at line 115 of file cfl_attributes.cpp.
void faudes::AttributeFlags::DoXWrite |
( |
TokenWriter & |
rTw, |
|
|
const std::string & |
rLabel = "" , |
|
|
const Type * |
pContext = 0 |
|
) |
| const |
|
protectedvirtual |
Write to TokenWriter, see Type for public wrappers.
If not the defult value, write the flags in XML format. Else, do nothing. The label and context arguments are ignored.
- Parameters
-
rTw | Reference to TokenWriter |
rLabel | Label of section to write |
pContext | Write context to provide contextual information |
- Exceptions
-
Reimplemented from faudes::Type.
Reimplemented in faudes::AttributeIosState, faudes::DiagLabelSet, faudes::AttributeCFlags, faudes::AttributeIosEvent, faudes::AttributeColoredState, faudes::AttributeDiagnoserState, faudes::AttributePushdownState, faudes::AttributeFailureTypeMap, and faudes::AttributeFailureEvents.
Definition at line 127 of file cfl_attributes.cpp.
virtual bool faudes::AttributeFlags::IsDefault |
( |
void |
| ) |
const |
|
inlinevirtual |
Test for default value.
Reimplemented from faudes::AttributeVoid.
Reimplemented in faudes::HioStateFlags, faudes::AttributeIosState, faudes::SimEventAttribute, faudes::AttributeSimCondition, faudes::HioEventFlags, faudes::AttributeGotoState, faudes::AttributeCFlags, faudes::AttributeIosEvent, faudes::AttributeTimedState, faudes::DiagLabelSet, faudes::AttributeColoredState, faudes::AttributeFailureTypeMap, faudes::AttributePushdownState, faudes::AttributeFailureEvents, faudes::AttributeDiagnoserState, and faudes::AttributeTimedTrans.
Definition at line 230 of file cfl_attributes.h.
void faudes::AttributeFlags::Set |
( |
fType |
mask | ) |
|
|
inline |
bool faudes::AttributeFlags::Test |
( |
fType |
mask | ) |
const |
|
inline |
bool faudes::AttributeFlags::TestAll |
( |
fType |
mask | ) |
const |
|
inline |
bool faudes::AttributeFlags::TestNone |
( |
fType |
mask | ) |
const |
|
inline |
bool faudes::AttributeFlags::TestSome |
( |
fType |
mask | ) |
const |
|
inline |
Member Data Documentation
const fType faudes::AttributeFlags::mDefFlags = 0x0 |
|
static |
fType faudes::AttributeFlags::mFlags |
The documentation for this class was generated from the following files:
libFAUDES 2.24g
--- 2014.09.15
--- c++ api documentaion by doxygen
|