libFAUDES

Sections

Index

faudes::AttributeCFlags Class Reference

#include <cgenerator.h>

Inherits faudes::AttributeFlags.

Inherited by faudes::SimEventAttribute.

List of all members.


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 cgenerator.h.


Public Member Functions

virtual AttributeCFlagsNew (void) const
 Construct on heap.
virtual AttributeCFlagsCopy (void) const
 Construct on heap.
virtual const AttributeCFlagsCast (const Type *pOther) const
 Cast other object to this type.
virtual AttributeCFlagsAssign (const Type &rSrc)
 Assign configuration data from other object.
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data.
virtual AttributeCFlagsoperator= (const AttributeCFlags &rSrc)
virtual bool operator== (const AttributeCFlags &rOther) const
virtual bool operator!= (const AttributeCFlags &rOther) const
 AttributeCFlags (void)
 Default constructor.
virtual ~AttributeCFlags (void)
 Destructor.
void SetControllable (void)
 Set controllable flag.
void ClrControllable (void)
 Clear controllable flag.
bool Controllable (void) const
 Query controllablility.
void SetObservable (void)
 Set observable flag.
void ClrObservable (void)
 Clear observable flag.
bool Observable (void) const
 Query observablility.
void SetForcible (void)
 Set forcible flag.
void ClrForcible (void)
 Clear forcible flag.
bool Forcible (void) const
 Query forcibility.
void SetHighlevel (void)
 Set abstraction flag.
void SetLowlevel (void)
 Clear abstraction flag.
bool Highlevel (void) const
 Query abstaction flag.
bool Lowlevel (void) const
 Query abstaction flag.
virtual bool IsDefault (void) const
 Test for default value.

Static Public Attributes

static const fType mControllableFlag = 0x01
static const fType mObservableFlag = 0x02
static const fType mForcibleFlag = 0x04
static const fType mAbstractionFlag = 0x08

Protected Member Functions

AttributeCFlagsDoAssign (const AttributeCFlags &rSrcAttr)
 Assignment method.
virtual bool DoEqual (const AttributeCFlags &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 AttributeVoid for public wrappers.
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Writes attribute to TokenWriter, see AttributeVoid for public wrappers.

Static Private Attributes

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

Constructor & Destructor Documentation

faudes::AttributeCFlags::AttributeCFlags ( void   )  [inline]

Default constructor.

Definition at line 64 of file cgenerator.h.

virtual faudes::AttributeCFlags::~AttributeCFlags ( void   )  [inline, virtual]

Destructor.

Definition at line 67 of file cgenerator.h.


Member Function Documentation

AttributeCFlags * faudes::AttributeCFlags::New ( void   )  const [virtual]

Construct on heap.

Technically not a constructor, this function creates an object with the same type Type. New() is defined as a virtual function and derived classes are meant to re-implement with the appropiate constructor. This can be done via the provided macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION. As with new, it is the callers reponsabilty to delete the object when no longer needed.

Returns:
Pointer to new Type object

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 40 of file cgenerator.cpp.

AttributeCFlags * faudes::AttributeCFlags::Copy ( void   )  const [virtual]

Construct on heap.

Technically not a constructor, this function creates an object with the same type Type and the same configuration. Copy() is defined as a virtual function and derived classes are meant to re-implement with the appropiate copy constructor. This can be done via the provided macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION. As with new, it is the callers reponsabilty to delete the object when no longer needed.

Returns:
Pointer to new Type object

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 40 of file cgenerator.cpp.

const AttributeCFlags * faudes::AttributeCFlags::Cast ( const Type pOther  )  const [virtual]

Cast other object to this type.

Enables the run-time interface to test whether pObject is derived from this object. This feature is used e.g. in the faudes container classes to test attributes. Derived classes must reimplement this function using the appropriate dynamic cast.

Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Returns:
Typed pointer object

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 40 of file cgenerator.cpp.

AttributeCFlags & faudes::AttributeCFlags::Assign ( const Type rSrc  )  [virtual]

Assign configuration data from other object.

Derived classes should reimplement this method to first try to cast the source to the respective class. If successful, the protected function DoAssign is invoked to perform the actual assignment. If the cast fails, the Assign method of the parent class is called. Thus, faudes objects are up- and downcatsted for assignment, maintaining as much of the source data as digestable by the destination object. On the downside, there is no sensible typechecking at compile-time.

Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters:
rSrc Source to copy from
Returns:
Reference to this object.

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 40 of file cgenerator.cpp.

bool faudes::AttributeCFlags::Equal ( const Type rOther  )  const [virtual]

Test equality of configuration data.

Derived classes should reimplement this method to return true if both actual types and configuration data match. The object name is not consired in the test.

This method calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Parameters:
rOther Other objevt to compare with.
Returns:
True on match.

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 40 of file cgenerator.cpp.

AttributeCFlags & faudes::AttributeCFlags::operator= ( const AttributeCFlags rSrc  )  [virtual]

Definition at line 40 of file cgenerator.cpp.

bool faudes::AttributeCFlags::operator== ( const AttributeCFlags rOther  )  const [virtual]

Definition at line 40 of file cgenerator.cpp.

bool faudes::AttributeCFlags::operator!= ( const AttributeCFlags rOther  )  const [virtual]

Definition at line 40 of file cgenerator.cpp.

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

Set controllable flag.

Definition at line 72 of file cgenerator.h.

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

Clear controllable flag.

Definition at line 78 of file cgenerator.h.

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

Query controllablility.

Definition at line 83 of file cgenerator.h.

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

Set observable flag.

Definition at line 89 of file cgenerator.h.

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

Clear observable flag.

Definition at line 94 of file cgenerator.h.

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

Query observablility.

Definition at line 99 of file cgenerator.h.

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

Set forcible flag.

Definition at line 105 of file cgenerator.h.

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

Clear forcible flag.

Definition at line 111 of file cgenerator.h.

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

Query forcibility.

Definition at line 116 of file cgenerator.h.

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

Set abstraction flag.

Definition at line 122 of file cgenerator.h.

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

Clear abstraction flag.

Definition at line 127 of file cgenerator.h.

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

Query abstaction flag.

Definition at line 132 of file cgenerator.h.

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

Query abstaction flag.

Definition at line 137 of file cgenerator.h.

virtual bool faudes::AttributeCFlags::IsDefault ( void   )  const [inline, virtual]

Test for default value.

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 143 of file cgenerator.h.

AttributeCFlags & faudes::AttributeCFlags::DoAssign ( const AttributeCFlags rSrcAttr  )  [protected]

Assignment method.

Parameters:
rSrcAttr Source to assign from

Definition at line 43 of file cgenerator.cpp.

bool faudes::AttributeCFlags::DoEqual ( const AttributeCFlags rOther  )  const [protected, virtual]

Test equality of configuration data.

Parameters:
rOther Other attribute to compare with.
Returns:
True on match.

Definition at line 51 of file cgenerator.cpp.

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

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:
rTr TokenReader to read from
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO error (id 1)

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 96 of file cgenerator.cpp.

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

Writes attribute to TokenWriter, see AttributeVoid for public wrappers.

Label and Context argument are ignored.

Parameters:
rTw TokenWriter to write to
rLabel Section to write
pContext Write context to provide contextual information
Exceptions:
Exception 
  • IO error (id 2)

Reimplemented from faudes::AttributeFlags.

Reimplemented in faudes::SimEventAttribute.

Definition at line 62 of file cgenerator.cpp.


Member Data Documentation

Definition at line 146 of file cgenerator.h.

Definition at line 147 of file cgenerator.h.

Definition at line 148 of file cgenerator.h.

Definition at line 149 of file cgenerator.h.

const fType faudes::AttributeCFlags::mDefCFlags = 0x0a [static, private]

Overall default value.

Definition at line 153 of file cgenerator.h.

const fType faudes::AttributeCFlags::mAllCFlags = 0x0f [static, private]

All flags used by CFlags.

Definition at line 156 of file cgenerator.h.


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

libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6