#include <cfl_attributes.h>

Public Member Functions

 AttributeVoid (void)
 
 AttributeVoid (const AttributeVoid &rSrcAttr)
 
virtual ~AttributeVoid (void)
 
virtual bool IsDefault (void) const
 
virtual void SetDefault (void)
 
virtual void Clear (void)
 
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 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 AttributeVoid &rSrcAttr)
 
bool DoEqual (const AttributeVoid &rOther) const
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual void DoXWrite (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
 

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 52 of file cfl_attributes.h.

Constructor & Destructor Documentation

◆ AttributeVoid() [1/2]

faudes::AttributeVoid::AttributeVoid ( void  )

Constructor

Definition at line 39 of file cfl_attributes.cpp.

◆ AttributeVoid() [2/2]

faudes::AttributeVoid::AttributeVoid ( const AttributeVoid rSrcAttr)

Copy Constructor

Definition at line 44 of file cfl_attributes.cpp.

◆ ~AttributeVoid()

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

Destructor

Definition at line 50 of file cfl_attributes.cpp.

Member Function Documentation

◆ Clear()

◆ DoAssign()

void faudes::AttributeVoid::DoAssign ( const AttributeVoid rSrcAttr)
inlineprotected

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
rSrcAttrSource to assign from

Definition at line 112 of file cfl_attributes.h.

◆ DoDWrite()

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

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
rTwReference to TokenWriter
rLabelLabel of section to write
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::Type.

Definition at line 61 of file cfl_attributes.cpp.

◆ DoEqual()

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

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

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

Definition at line 123 of file cfl_attributes.h.

◆ DoRead()

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

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
rTrTokenReader to read from
rLabelSection to read
pContextRead context to provide contextual information
Exceptions
Exception
  • IO error (id 1)

Reimplemented from faudes::Type.

Reimplemented in faudes::AttributePriority, faudes::AttributePGenGl, faudes::AttributeCFlags, faudes::AttributeFlags, faudes::AttributeTimedGlobal, faudes::AttributeTimedState, faudes::AttributeTimedTrans, faudes::SimEventAttribute, faudes::AttributeSimCondition, faudes::AttributeColoredState, faudes::AttributeIosState, faudes::AttributeIosEvent, faudes::AttributeDeviceEvent, faudes::AttributeSimplenetInput, faudes::AttributeSimplenetOutput, faudes::AttributeSignalInput, faudes::AttributeSignalOutput, faudes::AttributeLhaGlobal, faudes::AttributeLhaState, faudes::AttributeLhaTrans, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeFailureTypeMap, faudes::AttributeFailureEvents, faudes::DiagLabelSet, and faudes::AttributeDiagnoserState.

Definition at line 69 of file cfl_attributes.cpp.

◆ DoWrite()

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

◆ 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 391 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 340 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 375 of file cfl_types.cpp.

◆ SetDefault()

virtual void faudes::AttributeVoid::SetDefault ( void  )
inlinevirtual

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

Definition at line 80 of file cfl_attributes.h.

◆ Skip()

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
rTrTokenReader to read from
Exceptions
Exception
  • IO error (id 1)

Definition at line 75 of file cfl_attributes.cpp.


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

libFAUDES 2.33b --- 2025.05.07 --- c++ api documentaion by doxygen