Detailed Description

Extended Type to base Attributes. Attributes are used as template parameters for faudes containers and facilitate the modelling of customized properties of events, states and transitions. See the class faudes::AttributeFlags for a non-trivial example.

To derive a class from faudes::AttrType you should reimplement the virtual interface

The class faudes::AttrType extends the base Type marginally to distinguish void attributes from plain type objects; i.e., we introduce a marker in the type hierarchy. There is (almost) nothing functional about this class and we should find ways to go without.

Definition at line 1056 of file cfl_types.h.

#include <cfl_types.h>

Public Member Functions

 AttrType (void)
 
 AttrType (const AttrType &rSrc)
 
virtual ~AttrType (void)
 
virtual bool IsDefault (void) const
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 
 Type (const Type &rType)
 
virtual ~Type (void)
 
virtual TypeNew (void) const
 
virtual TypeCopy (void) const
 
virtual const TypeCast (const Type *pOther) const
 
virtual void Clear (void)
 
virtual TypeAssign (const Type &rSrc)
 
Typeoperator= (const Type &rSrc)
 
virtual bool Equal (const Type &rOther) const
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
virtual void Name (const std::string &rName)
 
virtual const std::string & Name (void) const
 
virtual const std::string & TypeName (void) const
 
void Write (const Type *pContext=0) const
 
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
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 
void XWrite (const Type *pContext=0) const
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 
void DWrite (const Type *pContext=0) const
 
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
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
void SWrite (TokenWriter &rTw) const
 
void SWrite (void) const
 
std::string ToSText (void) const
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 

Static Public Member Functions

static void Skip (TokenReader &rTr)
 

Protected Member Functions

void DoAssign (const AttrType &rSrc)
 
bool DoEqual (const AttrType &rOther) const
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoSWrite (TokenWriter &rTw) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Constructor & Destructor Documentation

◆ AttrType() [1/2]

faudes::AttrType::AttrType ( void  )

Constructor

Definition at line 354 of file cfl_types.cpp.

◆ AttrType() [2/2]

faudes::AttrType::AttrType ( const AttrType rSrc)

Copy Constructor

Definition at line 359 of file cfl_types.cpp.

◆ ~AttrType()

faudes::AttrType::~AttrType ( void  )
virtual

Destructor

Definition at line 364 of file cfl_types.cpp.

Member Function Documentation

◆ DoAssign()

void faudes::AttrType::DoAssign ( const AttrType rSrc)
inlineprotected

Assign (no members, dummy)

Definition at line 1095 of file cfl_types.h.

◆ DoEqual()

bool faudes::AttrType::DoEqual ( const AttrType rOther) const
inlineprotected

Test (no members, dummy)

Definition at line 1098 of file cfl_types.h.

◆ IsDefault()

◆ operator!=()

bool faudes::Type::operator!=

Test equality of configuration data. See operator==(const Type&).

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

Parameters
rOtherOther objevt to compare with.
Returns
True on mismatch.

Definition at line 406 of file cfl_types.cpp.

◆ operator=()

Type & faudes::Type::operator=

Assign configurationdata from other object. Derived classes should implement the operator form for the assignment for each source type which allows for a non-trivial assignment. This includes the particular case were the source and destination types match exactly. In the latter case the DoAssign method should be invoked. In contrast to the Assign function, the operator form must not be reimplemented for missmatched source types: the operator form only accepts sensible source types. This allows for compiletime typeckecking. However, the downside is that when the type is not known at compiletime, configuration is not properly assigned.

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

Parameters
rSrcSource to copy from
Returns
Reference to this object.

Definition at line 355 of file cfl_types.cpp.

◆ operator==()

bool faudes::Type::operator==

Test equality of configuration data. The operator form of the equality test is only defined for matching types, no cast will be performed. Thus, the test will be optimistic if the type is not known at compiletime. The object name or id is not considered in the test.

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

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

Definition at line 390 of file cfl_types.cpp.

◆ Skip()

void faudes::AttrType::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. This should go to BaseSet.

Parameters
rTrTokenReader to read from
Exceptions
Exception
  • IO error (id 1)

Definition at line 369 of file cfl_types.cpp.


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

libFAUDES 2.33h --- 2025.06.18 --- c++ api documentaion by doxygen