Detailed Description

Attribute class to model event controllability properties.

This attribute is meant to be an event attribute and can distinguish between controllable, observable, forcible and abstraction events. It is based on faudes::AttributeFlags and uses the lower four bits in the flag word to store the respective boolean values. The AttributeCFlags class adds convenience functions to access these bits and a default-value that corresponds to observable and neiter controllable nor forcible.

Presuming that only controllability flags are uses (different from default), the token representation is by an Option String consisting of the initials c,o,f and a, where initials are capitatised for set flags and default values are not written; eg +C+ for a controllable event that is observable (default), not forcible (default) and
an abstraction event (default). If other than the four controllability bits are used, std. hex format is used.

Definition at line 56 of file cfl_cgenerator.h.

#include <cfl_cgenerator.h>

Public Member Functions

 AttributeCFlags (void)
 Default constructor. More...
 
virtual ~AttributeCFlags (void)
 Destructor. More...
 
void SetControllable (void)
 Set controllable flag. More...
 
void ClrControllable (void)
 Clear controllable flag. More...
 
bool Controllable (void) const
 Query controllablility. More...
 
void SetObservable (void)
 Set observable flag. More...
 
void ClrObservable (void)
 Clear observable flag. More...
 
bool Observable (void) const
 Query observablility. More...
 
void SetForcible (void)
 Set forcible flag. More...
 
void ClrForcible (void)
 Clear forcible flag. More...
 
bool Forcible (void) const
 Query forcibility. More...
 
void SetHighlevel (void)
 Set abstraction flag. More...
 
void SetLowlevel (void)
 Clear abstraction flag. More...
 
bool Highlevel (void) const
 Query abstaction flag. More...
 
bool Lowlevel (void) const
 Query abstaction flag. More...
 
virtual bool IsDefault (void) const
 Test for default value. More...
 
- Public Member Functions inherited from faudes::AttributeFlags
 AttributeFlags (void)
 Default constructor. More...
 
 AttributeFlags (const AttributeFlags &rOther)
 Copy constructor. More...
 
virtual ~AttributeFlags (void)
 Destructor. More...
 
bool Test (fType mask) const
 Test a flag. More...
 
bool TestAll (fType mask) const
 Test multible flags, combine by "and". More...
 
bool TestSome (fType mask) const
 Test multible flags, combine by "or". More...
 
bool TestNone (fType mask) const
 Test multible flags, combine by "not or". More...
 
void Set (fType mask)
 Set multiple flags. More...
 
void Clr (fType mask)
 Clear multiple flags. More...
 
- Public Member Functions inherited from faudes::AttributeVoid
 AttributeVoid (void)
 Constructor. More...
 
 AttributeVoid (const AttributeVoid &rSrcAttr)
 Copy Constructor. More...
 
virtual ~AttributeVoid (void)
 Destructor. More...
 
virtual void SetDefault (void)
 Set to default value. More...
 
virtual void Clear (void)
 Synonym for SetDefault to match std interface. More...
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 Constructor. More...
 
 Type (const Type &rType)
 Copy constructor. More...
 
virtual ~Type (void)
 Destructor. More...
 
virtual TypeNew (void) const
 Construct on heap. More...
 
virtual TypeCopy (void) const
 Construct on heap. More...
 
virtual const TypeCast (const Type *pOther) const
 Cast other object to this type. More...
 
virtual TypeAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
virtual Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator!= (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual void Name (const std::string &rName)
 Set the objects's name. More...
 
virtual const std::string & Name (void) const
 Get objects's name. More...
 
virtual const std::string & TypeName (void) const
 Get objects's type name. More...
 
void Write (const Type *pContext=0) const
 Write configuration data to console. More...
 
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. More...
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 Write configuration data to a file. More...
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to TokenWriter. More...
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to an XML file. More...
 
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. More...
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in XML format to TokenWriter. More...
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a string. More...
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a formated string. More...
 
void DWrite (const Type *pContext=0) const
 Write configuration data to console, debugging format. More...
 
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. More...
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debug format to TokenWriter. More...
 
void SWrite (TokenWriter &rTw) const
 Write statistics comment to TokenWriter. More...
 
void SWrite (void) const
 Write statistics comment to console. More...
 
std::string ToSText (void) const
 Write statistics to a string. More...
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from file with label specified. More...
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from a string. More...
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from TokenReader with label sepcified. More...
 

Static Public Attributes

static const fType mControllableFlag =0x01
 
static const fType mObservableFlag =0x02
 
static const fType mForcibleFlag =0x04
 
static const fType mAbstractionFlag =0x08
 
- Static Public Attributes inherited from faudes::AttributeFlags
static const fType mDefFlags =0x0
 

Protected Member Functions

void DoAssign (const AttributeCFlags &rSrcAttr)
 Assignment method. More...
 
bool DoEqual (const AttributeCFlags &rOther) const
 Test equality of configuration data. More...
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Reads attribute from TokenReader, see AttributeVoid for public wrappers. More...
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Writes attribute to TokenWriter, see AttributeVoid for public wrappers. More...
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Writes attribute to TokenWriter (XML format), see AttributeVoid for public wrappers. More...
 
- Protected Member Functions inherited from faudes::AttributeFlags
void DoAssign (const AttributeFlags &rSrcAttr)
 Assignment method. More...
 
bool DoEqual (const AttributeFlags &rOther) const
 Test equality of configuration data. More...
 
- Protected Member Functions inherited from faudes::AttributeVoid
void DoAssign (const AttributeVoid &rSrcAttr)
 Assign attribute members. More...
 
bool DoEqual (const AttributeVoid &rOther) const
 Test equality of configuration data. More...
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Actual write method to write the attribute to a TokenWriter. More...
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
bool DoEqual (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Write statistical data as a comment to TokenWriter. More...
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 Get objects's type definition. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Static Private Attributes

static const fType mDefCFlags =0x0a
 Overall default value. More...
 
static const fType mAllCFlags =0x0f
 All flags used by CFlags. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from faudes::AttributeVoid
static void Skip (TokenReader &rTr)
 Skip attribute tokens. More...
 
- Public Attributes inherited from faudes::AttributeFlags
fType mFlags
 Flags (public access for convenience)
More...
 

Constructor & Destructor Documentation

◆ AttributeCFlags()

faudes::AttributeCFlags::AttributeCFlags ( void  )
inline

Default constructor.

Definition at line 64 of file cfl_cgenerator.h.

◆ ~AttributeCFlags()

virtual faudes::AttributeCFlags::~AttributeCFlags ( void  )
inlinevirtual

Destructor.

Definition at line 67 of file cfl_cgenerator.h.

Member Function Documentation

◆ ClrControllable()

void faudes::AttributeCFlags::ClrControllable ( void  )
inline

Clear controllable flag.

Definition at line 78 of file cfl_cgenerator.h.

◆ ClrForcible()

void faudes::AttributeCFlags::ClrForcible ( void  )
inline

Clear forcible flag.

Definition at line 111 of file cfl_cgenerator.h.

◆ ClrObservable()

void faudes::AttributeCFlags::ClrObservable ( void  )
inline

Clear observable flag.

Definition at line 94 of file cfl_cgenerator.h.

◆ Controllable()

bool faudes::AttributeCFlags::Controllable ( void  ) const
inline

Query controllablility.

Definition at line 83 of file cfl_cgenerator.h.

◆ DoAssign()

void faudes::AttributeCFlags::DoAssign ( const AttributeCFlags rSrcAttr)
protected

Assignment method.

Parameters
rSrcAttrSource to assign from

Definition at line 50 of file cfl_cgenerator.cpp.

◆ DoEqual()

bool faudes::AttributeCFlags::DoEqual ( const AttributeCFlags rOther) const
protected

Test equality of configuration data.

Parameters
rOtherOther attribute to compare with.
Returns
True on match.

Definition at line 56 of file cfl_cgenerator.cpp.

◆ DoRead()

void faudes::AttributeCFlags::DoRead ( TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0 
)
protectedvirtual

Reads attribute from TokenReader, see AttributeVoid for public wrappers.

Reads a single token if it can be interpreted as AttributeCFlag, that is, if it is a respective option string or hex number. Label and Context argument are ignored. No token mismatch exceptions are thrown on error.

Parameters
rTrTokenReader to read from
rLabelSection to read
pContextRead context to provide contextual information
Exceptions
Exception
  • IO error (id 1)

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 138 of file cfl_cgenerator.cpp.

◆ DoWrite()

void faudes::AttributeCFlags::DoWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Writes attribute to TokenWriter, see AttributeVoid for public wrappers.

Label and Context argument are ignored.

Parameters
rTwTokenWriter to write to
rLabelSection to write
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO error (id 2)

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 67 of file cfl_cgenerator.cpp.

◆ DoXWrite()

void faudes::AttributeCFlags::DoXWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Writes attribute to TokenWriter (XML format), see AttributeVoid for public wrappers.

Label and Context argument are ignored.

Parameters
rTwTokenWriter to write to
rLabelSection to write
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO error (id 2)

Reimplemented from faudes::AttributeFlags.

Definition at line 104 of file cfl_cgenerator.cpp.

◆ Forcible()

bool faudes::AttributeCFlags::Forcible ( void  ) const
inline

Query forcibility.

Definition at line 116 of file cfl_cgenerator.h.

◆ Highlevel()

bool faudes::AttributeCFlags::Highlevel ( void  ) const
inline

Query abstaction flag.

Definition at line 132 of file cfl_cgenerator.h.

◆ IsDefault()

virtual bool faudes::AttributeCFlags::IsDefault ( void  ) const
inlinevirtual

Test for default value.

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 143 of file cfl_cgenerator.h.

◆ Lowlevel()

bool faudes::AttributeCFlags::Lowlevel ( void  ) const
inline

Query abstaction flag.

Definition at line 137 of file cfl_cgenerator.h.

◆ Observable()

bool faudes::AttributeCFlags::Observable ( void  ) const
inline

Query observablility.

Definition at line 99 of file cfl_cgenerator.h.

◆ SetControllable()

void faudes::AttributeCFlags::SetControllable ( void  )
inline

Set controllable flag.

Definition at line 72 of file cfl_cgenerator.h.

◆ SetForcible()

void faudes::AttributeCFlags::SetForcible ( void  )
inline

Set forcible flag.

Definition at line 105 of file cfl_cgenerator.h.

◆ SetHighlevel()

void faudes::AttributeCFlags::SetHighlevel ( void  )
inline

Set abstraction flag.

Definition at line 122 of file cfl_cgenerator.h.

◆ SetLowlevel()

void faudes::AttributeCFlags::SetLowlevel ( void  )
inline

Clear abstraction flag.

Definition at line 127 of file cfl_cgenerator.h.

◆ SetObservable()

void faudes::AttributeCFlags::SetObservable ( void  )
inline

Set observable flag.

Definition at line 89 of file cfl_cgenerator.h.

Member Data Documentation

◆ mAbstractionFlag

const fType faudes::AttributeCFlags::mAbstractionFlag =0x08
static

Definition at line 149 of file cfl_cgenerator.h.

◆ mAllCFlags

const fType faudes::AttributeCFlags::mAllCFlags =0x0f
staticprivate

All flags used by CFlags.

Definition at line 156 of file cfl_cgenerator.h.

◆ mControllableFlag

const fType faudes::AttributeCFlags::mControllableFlag =0x01
static

Definition at line 146 of file cfl_cgenerator.h.

◆ mDefCFlags

const fType faudes::AttributeCFlags::mDefCFlags =0x0a
staticprivate

Overall default value.

Definition at line 153 of file cfl_cgenerator.h.

◆ mForcibleFlag

const fType faudes::AttributeCFlags::mForcibleFlag =0x04
static

Definition at line 148 of file cfl_cgenerator.h.

◆ mObservableFlag

const fType faudes::AttributeCFlags::mObservableFlag =0x02
static

Definition at line 147 of file cfl_cgenerator.h.


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

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen