libFAUDES

Sections

Index

faudes::AttributeVoid Class Reference

#include <attributes.h>

Inherits faudes::Type.

Inherited by faudes::AttributeDeviceEvent, faudes::AttributeFlags, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, faudes::AttributeTimedGlobal, and faudes::SimConditionAttribute.

List of all members.


Detailed Description

Minimal Attribute.

Attributes are used as template parameters for faudes containers and generators and facilitate the modelling of customized properties of events, states and transitions. The AttributeVoid class defines the minimal interface of faudes attributes and therefore is the designated base class for all attribute implementations. The AttributeVoid class does not define any actual properties. See AttributeFlags for a non-trivial example.

To derive a class from AttributeVoid you should reimplement the virtual interface

Definition at line 51 of file attributes.h.


Public Member Functions

virtual AttributeVoidNew (void) const
 Construct on heap.
virtual AttributeVoidCopy (void) const
 Construct on heap.
virtual const AttributeVoidCast (const Type *pOther) const
 Cast other object to this type.
virtual AttributeVoidAssign (const Type &rSrc)
 Assign configuration data from other object.
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data.
virtual AttributeVoidoperator= (const AttributeVoid &rSrc)
virtual bool operator== (const AttributeVoid &rOther) const
virtual bool operator!= (const AttributeVoid &rOther) const
 AttributeVoid (void)
 Constructor.
virtual ~AttributeVoid (void)
 Destructor.
virtual bool IsDefault (void) const
 Test for default value.
virtual void SetDefault (void)
 Set to default value.
virtual void Clear (void)
 Synonym for SetDefault to match std interface.

Static Public Member Functions

static void Skip (TokenReader &rTr)
 Skip attribute tokens.

Protected Member Functions

virtual AttributeVoidDoAssign (const AttributeVoid &rSrcAttr)
 Assign attribute members.
virtual bool DoEqual (const AttributeVoid &rOther) const
 Test equality of configuration data.
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Actual read method to read attribute from tokenreader.
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Actual write method to write the attribute to a TokenWriter.

Constructor & Destructor Documentation

faudes::AttributeVoid::AttributeVoid ( void   ) 

Constructor.

Definition at line 38 of file attributes.cpp.

faudes::AttributeVoid::~AttributeVoid ( void   )  [virtual]

Destructor.

Definition at line 43 of file attributes.cpp.


Member Function Documentation

AttributeVoid * faudes::AttributeVoid::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::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSignalEvent, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, faudes::AttributeSimplenetEvent, and faudes::AttributeDeviceEvent.

Definition at line 35 of file attributes.cpp.

AttributeVoid * faudes::AttributeVoid::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::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSignalEvent, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, faudes::AttributeSimplenetEvent, and faudes::AttributeDeviceEvent.

Definition at line 35 of file attributes.cpp.

const AttributeVoid * faudes::AttributeVoid::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::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSignalEvent, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, faudes::AttributeSimplenetEvent, and faudes::AttributeDeviceEvent.

Definition at line 35 of file attributes.cpp.

AttributeVoid & faudes::AttributeVoid::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::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSignalEvent, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, faudes::AttributeSimplenetEvent, and faudes::AttributeDeviceEvent.

Definition at line 35 of file attributes.cpp.

bool faudes::AttributeVoid::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::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSignalEvent, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, faudes::AttributeSimplenetEvent, and faudes::AttributeDeviceEvent.

Definition at line 35 of file attributes.cpp.

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

Definition at line 35 of file attributes.cpp.

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

Definition at line 35 of file attributes.cpp.

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

Definition at line 35 of file attributes.cpp.

virtual void faudes::AttributeVoid::SetDefault ( void   )  [inline, virtual]

Set to default value.

Derived classes must reimplement this function for Clear to operate properly.

Definition at line 72 of file attributes.h.

void faudes::AttributeVoid::Skip ( TokenReader rTr  )  [static]

Skip attribute tokens.

Helper method to be called after all sttribute derived classes had their chance to read their data. It skips all tokens and sections until it reaches a String or decimal Integer.

Parameters:
rTr TokenReader to read from
Exceptions:
Exception 
  • IO error (id 1)

Definition at line 60 of file attributes.cpp.

virtual AttributeVoid& faudes::AttributeVoid::DoAssign ( const AttributeVoid rSrcAttr  )  [inline, protected, virtual]

Assign attribute members.

Since AttributeVoid has no members, this method does nothing. Derived classes are meant to reimplement DoAssign by first calling their base and then assigning additional member variables.

Parameters:
rSrcAttr Source to assign from

Definition at line 104 of file attributes.h.

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

Test equality of configuration data.

Derived attributes should reimplement this class to compare configuration data. The base AttributeVoid returns true as a default.

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

Definition at line 115 of file attributes.h.

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

Actual read method to read attribute from tokenreader.

For derived attributue classes, this method must either read all tokens that belong to the respective attribute, or none. It may throw exceptions on token mismatch within the relevant attribute, but it may not throw exceptions when it encounters tokens that possibly belong to another attribute. The latter are to be skipped by the provided Skip method. See Type::Read for public wrappers.

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::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, and faudes::AttributeDeviceEvent.

Definition at line 54 of file attributes.cpp.

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

Actual write method to write the attribute to a TokenWriter.

Reimplement this method for derived attribute classes to define the token io format. See Type::Write for public wrappers.

Parameters:
rTw Reference to TokenWriter
rLabel Label of section to write
pContext Write context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 2)

Reimplemented from faudes::Type.

Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::AttributeSignalActuator, faudes::AttributeSignalSensor, faudes::AttributeSimplenetActuator, faudes::AttributeSimplenetSensor, and faudes::AttributeDeviceEvent.

Definition at line 48 of file attributes.cpp.


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