|
Minimal Attribute.
More...
#include <cfl_attributes.h>
Public Member Functions |
| 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.
|
| Type (void) |
| Constructor.
|
| Type (const Type &rType) |
| Copy constructor.
|
virtual | ~Type (void) |
| Destructor.
|
virtual Type * | New (void) const |
| Construct on heap.
|
virtual Type * | Copy (void) const |
| Construct on heap.
|
virtual const Type * | Cast (const Type *pOther) const |
| Cast other object to this type.
|
virtual Type & | Assign (const Type &rSrc) |
| Assign configuration data from other object.
|
virtual Type & | operator= (const Type &rSrc) |
| Assign configurationdata from other object.
|
virtual bool | Equal (const Type &rOther) const |
| Test equality of configuration data.
|
virtual bool | operator== (const Type &rOther) const |
| Test equality of configuration data.
|
virtual bool | operator!= (const Type &rOther) const |
| Test equality of configuration data.
|
virtual void | Name (const std::string &rName) |
| Set the objects's name.
|
virtual const std::string & | Name (void) const |
| Get objects's name.
|
void | Write (const Type *pContext=0) const |
| Write configuration data to console.
|
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.
|
void | Write (const std::string &pFileName, std::ios::openmode openmode) const |
| Write configuration data to a file.
|
void | Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to TokenWriter.
|
virtual void | XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to an XML file.
|
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.
|
void | XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data in XML format to TokenWriter.
|
std::string | ToString (const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to a string.
|
std::string | ToText (const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data to a formated string.
|
void | DWrite (const Type *pContext=0) const |
| Write configuration data to console, debugging format.
|
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.
|
void | DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data in debug format to TokenWriter.
|
void | SWrite (TokenWriter &rTw) const |
| Write statistics comment to TokenWriter.
|
void | SWrite (void) const |
| Write statistics comment to console.
|
std::string | ToSText (void) const |
| Write statistics to a string.
|
void | Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0) |
| Read configuration data from file with label specified.
|
void | FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0) |
| Read configuration data from a string.
|
void | Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
| Read configuration data from TokenReader with label sepcified.
|
Static Public Member Functions |
static void | Skip (TokenReader &rTr) |
| Skip attribute tokens.
|
Protected Member Functions |
void | DoAssign (const AttributeVoid &rSrcAttr) |
| Assign attribute members.
|
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 | DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Actual write method to write the attribute to a TokenWriter.
|
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Actual write method to write the attribute to a TokenWriter.
|
void | DoAssign (const Type &rSrc) |
| Assign configuration data from other object.
|
bool | DoEqual (const Type &rOther) const |
| Test equality of configuration data.
|
virtual void | DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
| Write configuration data of this object to TokenWriter in XML format.
|
virtual void | DoSWrite (TokenWriter &rTw) const |
| Write statistical data as a comment to TokenWriter.
|
virtual const TypeDefinition * | TypeDefinitionp (void) const |
| Get objects's type definition.
|
virtual const std::string & | TypeName (void) const |
| Get objects's type name.
|
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
faudes::AttributeVoid::AttributeVoid |
( |
void |
| ) |
|
faudes::AttributeVoid::~AttributeVoid |
( |
void |
| ) |
|
|
virtual |
Member Function Documentation
virtual void faudes::AttributeVoid::Clear |
( |
void |
| ) |
|
|
inlinevirtual |
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
-
rSrcAttr | Source to assign from |
Definition at line 105 of file cfl_attributes.h.
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
-
rTw | Reference to TokenWriter |
rLabel | Label of section to write |
pContext | Write context to provide contextual information |
- Exceptions
-
Reimplemented from faudes::Type.
Definition at line 54 of file cfl_attributes.cpp.
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
-
rOther | Other object to compare with. |
- Returns
- True on match.
Definition at line 116 of file cfl_attributes.h.
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
-
rTr | TokenReader to read from |
rLabel | Section to read |
pContext | Read context to provide contextual information |
- Exceptions
-
Reimplemented from faudes::Type.
Reimplemented in faudes::AttributeSimCondition, faudes::SimEventAttribute, faudes::AttributeFlags, faudes::AttributeTimedGlobal, faudes::AttributeSimplenetInput, faudes::AttributeCFlags, faudes::AttributeSignalInput, faudes::AttributeDeviceEvent, faudes::AttributeTimedState, faudes::AttributeSimplenetOutput, faudes::AttributeSignalOutput, and faudes::AttributeTimedTrans.
Definition at line 62 of file cfl_attributes.cpp.
void faudes::AttributeVoid::DoWrite |
( |
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
-
rTw | Reference to TokenWriter |
rLabel | Label of section to write |
pContext | Write context to provide contextual information |
- Exceptions
-
Reimplemented from faudes::Type.
Reimplemented in faudes::AttributeSimCondition, faudes::SimEventAttribute, faudes::AttributeFlags, faudes::AttributeTimedGlobal, faudes::AttributeSimplenetInput, faudes::AttributeSignalInput, faudes::AttributeCFlags, faudes::AttributeDeviceEvent, faudes::AttributeTimedState, faudes::AttributeSimplenetOutput, faudes::AttributeSignalOutput, and faudes::AttributeTimedTrans.
Definition at line 48 of file cfl_attributes.cpp.
virtual bool faudes::AttributeVoid::IsDefault |
( |
void |
| ) |
const |
|
inlinevirtual |
Test for default value.
Reimplemented in faudes::AttributeSimplenetEvent, faudes::AttributeFlags, faudes::AttributeSignalEvent, faudes::AttributeTimedGlobal, faudes::AttributeSimplenetInput, faudes::SimEventAttribute, faudes::AttributeSimCondition, faudes::AttributeSignalInput, faudes::AttributeCFlags, faudes::AttributeTimedState, faudes::AttributeSimplenetOutput, faudes::AttributeDeviceEvent, faudes::AttributeSignalOutput, and faudes::AttributeTimedTrans.
Definition at line 67 of file cfl_attributes.h.
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 73 of file cfl_attributes.h.
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
-
- Exceptions
-
Definition at line 68 of file cfl_attributes.cpp.
The documentation for this class was generated from the following files:
libFAUDES 2.28a
--- 2016.09.13
--- c++ api documentaion by doxygen
|