|
libFAUDES
Sections
Index
|
faudes::Type Class Reference
|
Public Member Functions | |
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 void | Clear (void) |
Clear configuration data. | |
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 TokenWriter. | |
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) |
Write configuration data to a string. | |
void | Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Read configuration data from TokenReader with label sepcified. | |
Protected Member Functions | |
virtual void | DoAssign (const Type &rSrc) |
Assign configuration data from other object. | |
virtual bool | DoEqual (const Type &rOther) const |
Test equality of configuration data. | |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Read configuration data of this object from TokenReader. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write configuration data of this object to TokenWriter. | |
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 | DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write configuration data in debugging format to TokenWriter. | |
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. | |
Static Private Attributes | |
static std::string | msStringVoid |
static std::string | msStringEmpty |
Base class of all libFAUDES objects that participate in the run-time interface.
Eg, generator, alphabet, attributes etc. The class is designed to impose as little overhead as possible, and hence, does not hold any data. It does, however, provide a uniform interface for assignment, factory functions, and token IO.
We think of a faudes-typed object to be configured by defining data and, in due course, manipulated via its public interface by faudes-functions. Any faudes-type must provide a Clear() method that resets the object configuration to a unique default value. It is the configuration data that can be read from and written to token streams, and it is the configuration data that is used for assigments. Any additional data a faudes-typed object may host, is ignored by the interface inherited from the the base faudes::Type. Examples for such additional data is the unique id of a Generator, and the deferred copy pointers in faudes sets derived from faudes::TBaseSet.
The faudes::Type assignment semantics are not meant to create exact copies of a given source object. Thogether with the uniquely defined default value, we can have assignments by both up- and downcasts. A faudes::Generator can be assigned from the derived faudes::System (a Generator with controllability attributes) by dropping the extra features. Vice versa, when a System is assigned from a plain Generator, any extra features take their respective default values. This relaxed interpretation of assignments is implemented by the method Assign(). The token format for file IO is organised in a similar fashion: any generator derivate can be configured from the token stream produced by any other generator class. In contrast, faudes-typed objects also implement an assignment operator that uses the standard C++ conventions.
The follwoing methods are used to implement the faudes::Type interface:
In most cases, only DoRead(), DoWrite(), DoAssign() and DoEqual() need to me implemented manualy. the other methods can be declared and implemented by macros FAUDES_TYPE_DELARATION and FAUDES_TYPE_IMPLEMENTATION, respectively. The various Attribute classes illustrate their ussage.
Note on token IO: In libFAUDES 2.16e, implementation of a new file format is prepared by the virtual function interface DoXWrite(). The intention is to better support advanced XML editors, in particular for configuration files. When implementing DoXWrite() for a derived class, make sure that DoRead() will gracefully accept tokens written by both DoWrite() and DoXWrite(), as a basis for a fileformat conversion tool. Future versions of libFAUDES will drop compatibility with the old token format, except for model data (generators, alphabets).
Definition at line 239 of file cfl_types.h.
faudes::Type::Type | ( | void | ) |
Constructor.
Definition at line 45 of file cfl_types.cpp.
faudes::Type::Type | ( | const Type & | rType | ) |
Copy constructor.
Definition at line 48 of file cfl_types.cpp.
faudes::Type::~Type | ( | void | ) | [virtual] |
Destructor.
Definition at line 51 of file cfl_types.cpp.
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 downcatsed 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.
rSrc | Source to copy from |
Reimplemented in faudes::vGenerator.
Definition at line 74 of file cfl_types.cpp.
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.
Reimplemented in faudes::TaBaseSet< T, Attr, Cmp >, faudes::Integer, faudes::String, faudes::Boolean, faudes::TaBaseSet< Idx, AttributeSimplenetEvent >, faudes::TaBaseSet< Transition, Attr, TransSort::X1EvX2 >, faudes::TaBaseSet< Idx, EventAttr >, faudes::TaBaseSet< Idx, HioEventFlags >, faudes::TaBaseSet< Idx, AttributeSignalEvent >, faudes::TaBaseSet< Idx, DiagLabelSet >, faudes::TaBaseSet< Idx, StateAttr >, faudes::TaBaseSet< Idx, AttributeFailureEvents >, faudes::TaBaseSet< Idx, AttributeSimCondition >, faudes::TaBaseSet< Idx, SimEventAttribute >, faudes::TaBaseSet< Idx, HioStateFlags >, and faudes::TaBaseSet< Idx, Attr >.
Definition at line 64 of file cfl_types.cpp.
void faudes::Type::Clear | ( | void | ) | [virtual] |
Clear configuration data.
Derived classes should re-implement this method to ensure some consistent configuration data.
Reimplemented in faudes::TaBaseSet< T, Attr, Cmp >, faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::AttributeVoid, faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::Signature, faudes::FunctionDefinition, faudes::vGenerator, faudes::TaIndexSet< Attr >, faudes::TypeRegistry, faudes::FunctionRegistry, faudes::SymbolTable, faudes::TaTransSet< Attr >, faudes::Documentation, faudes::TypeDefinition, faudes::EventRelabelMap, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::DeviceExecutor, faudes::Executor, faudes::LoggingExecutor, faudes::ParallelExecutor, faudes::ProposingExecutor, faudes::AttributeSignalOutput, faudes::AttributeSignalInput, faudes::AttributeSignalEvent, faudes::sDevice, faudes::AttributeSimplenetOutput, faudes::AttributeSimplenetInput, faudes::AttributeSimplenetEvent, faudes::nDevice, faudes::AttributeDeviceEvent, faudes::vDevice, faudes::xDevice, faudes::LuaFunctionDefinition, faudes::TaBaseSet< Idx, AttributeSimplenetEvent >, faudes::TaBaseSet< Transition, Attr, TransSort::X1EvX2 >, faudes::TaBaseSet< Idx, EventAttr >, faudes::TaBaseSet< Idx, HioEventFlags >, faudes::TaBaseSet< Idx, AttributeSignalEvent >, faudes::TaBaseSet< Idx, DiagLabelSet >, faudes::TaBaseSet< Idx, StateAttr >, faudes::TaBaseSet< Idx, AttributeFailureEvents >, faudes::TaBaseSet< Idx, AttributeSimCondition >, faudes::TaBaseSet< Idx, SimEventAttribute >, faudes::TaBaseSet< Idx, HioStateFlags >, faudes::TaBaseSet< Idx, Attr >, faudes::TaGenerator< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, faudes::TBaseSet< Transition, Cmp >, faudes::TaIndexSet< DiagLabelSet >, faudes::TaIndexSet< HioStateFlags >, and faudes::TaIndexSet< StateAttr >.
Definition at line 69 of file cfl_types.cpp.
Type * faudes::Type::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.
Reimplemented in faudes::TaBaseSet< T, Attr, Cmp >, faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::Integer, faudes::String, faudes::Boolean, faudes::vGenerator, faudes::EventRelabelMap, faudes::TdiagGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioConstraint< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioController< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioEnvironment< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioPlant< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TIoSystem< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TmtcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TtGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TaBaseSet< Idx, AttributeSimplenetEvent >, faudes::TaBaseSet< Transition, Attr, TransSort::X1EvX2 >, faudes::TaBaseSet< Idx, EventAttr >, faudes::TaBaseSet< Idx, HioEventFlags >, faudes::TaBaseSet< Idx, AttributeSignalEvent >, faudes::TaBaseSet< Idx, DiagLabelSet >, faudes::TaBaseSet< Idx, StateAttr >, faudes::TaBaseSet< Idx, AttributeFailureEvents >, faudes::TaBaseSet< Idx, AttributeSimCondition >, faudes::TaBaseSet< Idx, SimEventAttribute >, faudes::TaBaseSet< Idx, HioStateFlags >, faudes::TaBaseSet< Idx, Attr >, faudes::TaGenerator< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::THioConstraint< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::THioController< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::THioEnvironment< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, and faudes::THioPlant< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >.
Definition at line 59 of file cfl_types.cpp.
void faudes::Type::DoAssign | ( | const Type & | rSrc | ) | [protected, virtual] |
Assign configuration data from other object.
Reimplement this function to copy all configuration data from another faudes object. Typically, you will first call the base class' DoAssign, which includes a Clear(). Then, you will set up any additional members.
rSrc | Source to copy from |
Definition at line 103 of file cfl_types.cpp.
void faudes::Type::DoDWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write configuration data in debugging format to TokenWriter.
Reimplement this method in derived classes to provide the std token io interface defined in the public section of Type.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::vGenerator, faudes::NameSet, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 290 of file cfl_types.cpp.
bool faudes::Type::DoEqual | ( | const Type & | rOther | ) | const [protected, virtual] |
Test equality of configuration data.
Derived classes should reimplement this method to compare all relevant configuration, except the name.
rOther | Other object to compare with. |
Definition at line 108 of file cfl_types.cpp.
void faudes::Type::DoRead | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Read configuration data of this object from TokenReader.
Reimplement this method in derived classes to provide the std token io interface defined in the public section of Type.
rTr | TokenReader to read from | |
rLabel | Section to read | |
pContext | Read context to provide contextual information |
Exception |
|
Reimplemented in faudes::AttributeVoid, faudes::AttributeFlags, faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::AttributeCFlags, faudes::Integer, faudes::String, faudes::Boolean, faudes::Signature, faudes::FunctionDefinition, faudes::vGenerator, faudes::IndexSet, faudes::NameSet, faudes::SymbolSet, faudes::SymbolTable, faudes::Documentation, faudes::TypeDefinition, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeIosEvent, faudes::AttributeIosState, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::LoggingExecutor, faudes::ParallelExecutor::ParallelTimedState, faudes::ParallelExecutor, faudes::ProposingExecutor, faudes::AttributeSimCondition, faudes::SimEventAttribute, faudes::AttributeSignalOutput, faudes::AttributeSignalInput, faudes::AttributeSimplenetOutput, faudes::AttributeSimplenetInput, faudes::AttributeDeviceEvent, faudes::vDevice, faudes::LuaFunctionDefinition, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 304 of file cfl_types.cpp.
void faudes::Type::DoSWrite | ( | TokenWriter & | rTw | ) | const [protected, virtual] |
Write statistical data as a comment to TokenWriter.
Reimplement this method in derived classes to provide the std token io interface defined in the public section of Type.
rTw | Reference to TokenWriter |
Exception |
|
Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::vGenerator, faudes::TmtcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 296 of file cfl_types.cpp.
void faudes::Type::DoWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write configuration data of this object to TokenWriter.
Reimplement this method in derived classes to provide the std token io interface defined in the public section of Type.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented in faudes::AttributeVoid, faudes::AttributeFlags, faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::AttributeCFlags, faudes::Integer, faudes::String, faudes::Boolean, faudes::Signature, faudes::FunctionDefinition, faudes::Function, faudes::vGenerator, faudes::IndexSet, faudes::NameSet, faudes::TypeRegistry, faudes::FunctionRegistry, faudes::SymbolSet, faudes::SymbolTable, faudes::TTransSet< Cmp >, faudes::Documentation, faudes::TypeDefinition, faudes::AttributeDiagnoserState, faudes::AttributeFailureEvents, faudes::AttributeFailureTypeMap, faudes::DiagLabelSet, faudes::TdiagGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::HioEventFlags, faudes::HioStateFlags, faudes::AttributeIosEvent, faudes::AttributeIosState, faudes::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::LoggingExecutor, faudes::ParallelExecutor::ParallelTimedState, faudes::ParallelExecutor, faudes::ProposingExecutor, faudes::AttributeSimCondition, faudes::SimEventAttribute, faudes::AttributeSignalOutput, faudes::AttributeSignalInput, faudes::AttributeSimplenetOutput, faudes::AttributeSimplenetInput, faudes::AttributeDeviceEvent, faudes::vDevice, faudes::LuaFunctionDefinition, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, faudes::TBaseSet< Transition, Cmp >, faudes::TTransSet< TransSort::X1EvX2 >, and faudes::TTransSet< TransSort::EvX2X1 >.
Definition at line 279 of file cfl_types.cpp.
void faudes::Type::DoXWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write configuration data of this object to TokenWriter in XML format.
Reimplement this method in derived classes to provide the XML token io interface defined in the public section of Type. The default implementation invokes the std token output via DoWrite(TokenWriter&, const std::string&,const Type* )
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented in faudes::AttributeFlags, faudes::AttributeCFlags, and faudes::NameSet.
Definition at line 285 of file cfl_types.cpp.
void faudes::Type::DWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const |
Write configuration data in debug format to TokenWriter.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Definition at line 242 of file cfl_types.cpp.
void faudes::Type::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.
Note: this write function uses the virtual function DoDWrite(), to be reimplemented by derived classes.
pFileName | Name of file | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information | |
openmode | ios::openmode |
Exception |
|
Definition at line 228 of file cfl_types.cpp.
void faudes::Type::DWrite | ( | const Type * | pContext = 0 |
) | const |
Write configuration data to console, debugging format.
Note: this write function uses the virtual function DoDWrite(), to be reimplemented by derived classes.
pContext | Write context to provide contextual information |
Definition at line 222 of file cfl_types.cpp.
bool faudes::Type::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 or id (if any) is not considered 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.
rOther | Other object to compare with. |
Definition at line 81 of file cfl_types.cpp.
void faudes::Type::FromString | ( | const std::string & | rString, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) |
Write configuration data to a string.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
rString | String to read from | |
rLabel | Section to read | |
pContext | Read context to provide contextual information |
Definition at line 272 of file cfl_types.cpp.
const std::string & faudes::Type::Name | ( | void | ) | const [virtual] |
Get objects's name.
The base class Type does not implement an object name, derivatives usually do so, except for attributes.
Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::Signature, faudes::vGenerator, faudes::SymbolTable, faudes::Documentation, faudes::Executor, faudes::vDevice, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 119 of file cfl_types.cpp.
void faudes::Type::Name | ( | const std::string & | rName | ) | [virtual] |
Set the objects's name.
The base class Type does not implement an object name, derivatives usually do so, except for attributes.
rName | Name |
Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::vBaseVector, faudes::Signature, faudes::vGenerator, faudes::SymbolTable, faudes::Documentation, faudes::vDevice, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 114 of file cfl_types.cpp.
Type * faudes::Type::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.
Reimplemented in faudes::TaBaseSet< T, Attr, Cmp >, faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::Integer, faudes::String, faudes::Boolean, faudes::Function, faudes::vGenerator, faudes::EventRelabelMap, faudes::TdiagGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioConstraint< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioController< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioEnvironment< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::THioPlant< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TIoSystem< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TmtcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::TtGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::LuaFunction, faudes::TaBaseSet< Idx, AttributeSimplenetEvent >, faudes::TaBaseSet< Transition, Attr, TransSort::X1EvX2 >, faudes::TaBaseSet< Idx, EventAttr >, faudes::TaBaseSet< Idx, HioEventFlags >, faudes::TaBaseSet< Idx, AttributeSignalEvent >, faudes::TaBaseSet< Idx, DiagLabelSet >, faudes::TaBaseSet< Idx, StateAttr >, faudes::TaBaseSet< Idx, AttributeFailureEvents >, faudes::TaBaseSet< Idx, AttributeSimCondition >, faudes::TaBaseSet< Idx, SimEventAttribute >, faudes::TaBaseSet< Idx, HioStateFlags >, faudes::TaBaseSet< Idx, Attr >, faudes::TaGenerator< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::THioConstraint< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::THioController< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, faudes::THioEnvironment< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >, and faudes::THioPlant< AttributeVoid, HioStateFlags, HioEventFlags, AttributeVoid >.
Definition at line 54 of file cfl_types.cpp.
bool faudes::Type::operator!= | ( | const Type & | rOther | ) | const [virtual] |
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.
rOther | Other objevt to compare with. |
Definition at line 91 of file cfl_types.cpp.
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.
rSrc | Source to copy from |
Definition at line 96 of file cfl_types.cpp.
bool faudes::Type::operator== | ( | const Type & | rOther | ) | const [virtual] |
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.
rOther | Other object to compare with. |
Definition at line 86 of file cfl_types.cpp.
void faudes::Type::Read | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) |
Read configuration data from TokenReader with label sepcified.
Note: all read functions use the virtual function DoRead(), to be reimplemented for by derived classes.
rTr | Reference to tokenreader | |
rLabel | Section to read | |
pContext | Read context to provide contextual information |
Definition at line 266 of file cfl_types.cpp.
void faudes::Type::Read | ( | const std::string & | rFileName, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) |
Read configuration data from file with label specified.
Note: all read functions use the virtual function DoRead(), to be reimplemented for by derived classes.
rFileName | Name of file | |
rLabel | Section to read from | |
pContext | Read context to provide contextual information |
Definition at line 258 of file cfl_types.cpp.
void faudes::Type::SWrite | ( | void | ) | const |
Write statistics comment to console.
Note: this write function uses the virtual function DoSWrite(), to be reimplemented by derived classes.
Definition at line 247 of file cfl_types.cpp.
void faudes::Type::SWrite | ( | TokenWriter & | rTw | ) | const |
Write statistics comment to TokenWriter.
Note: this write function use the virtual function DoSWrite(), to be reimplemented by derived classes.
rTw | Reference to TokenWriter |
Exception |
|
Definition at line 253 of file cfl_types.cpp.
std::string faudes::Type::ToSText | ( | void | ) | const |
Write statistics to a string.
Note: this write function uses the virtual function DoSWrite(), to be reimplemented by derived classes.
Exception |
|
Definition at line 174 of file cfl_types.cpp.
std::string faudes::Type::ToString | ( | const std::string & | rLabel = "" , |
|
const Type * | pContext = 0 | |||
) | const |
Write configuration data to a string.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Definition at line 166 of file cfl_types.cpp.
std::string faudes::Type::ToText | ( | const std::string & | rLabel = "" , |
|
const Type * | pContext = 0 | |||
) | const |
Write configuration data to a formated string.
In contrast to ToString, ToText does not suppress comments and End-Of-Line marks. Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Definition at line 182 of file cfl_types.cpp.
const TypeDefinition * faudes::Type::TypeDefinitionp | ( | void | ) | const [protected, virtual] |
Get objects's type definition.
Returns the type definition corresponding to this object, or NULL if the object is not of a registered type.
Technical note: for minimal memory requirement, the type definition is not cached but retrieved on every invokation of this method. Derived classes may reimplement this method for performance reasons. Options include a look-up cache or a static member for the actual type definition. The latter variant will make the type independant from the type registry.
Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 124 of file cfl_types.cpp.
const std::string & faudes::Type::TypeName | ( | void | ) | const [protected, virtual] |
Get objects's type name.
Retrieve the faudes-type name from the type registry. However, this method silently returns the empty string if the type is not (yet) registered.
Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::TBaseSet< std::string >, faudes::TBaseSet< Idx >, faudes::TBaseSet< Transition, TransSort::EvX2X1 >, faudes::TBaseSet< Idx, std::less< Idx > >, faudes::TBaseSet< Transition, TransSort::X1EvX2 >, and faudes::TBaseSet< Transition, Cmp >.
Definition at line 129 of file cfl_types.cpp.
void faudes::Type::Write | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const |
Write configuration data to TokenWriter.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Definition at line 161 of file cfl_types.cpp.
void faudes::Type::Write | ( | const std::string & | pFileName, | |
std::ios::openmode | openmode | |||
) | const |
Write configuration data to a file.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
pFileName | Name of file | |
openmode | ios::openmode |
Exception |
|
Definition at line 156 of file cfl_types.cpp.
void faudes::Type::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.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
pFileName | Name of file | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information | |
openmode | ios::openmode |
Exception |
|
Definition at line 142 of file cfl_types.cpp.
void faudes::Type::Write | ( | const Type * | pContext = 0 |
) | const |
Write configuration data to console.
Note: this write function uses the virtual function DoWrite(), to be reimplemented by derived classes.
pContext | Write context to provide contextual information |
Definition at line 136 of file cfl_types.cpp.
void faudes::Type::XWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const |
Write configuration data in XML format to TokenWriter.
Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Definition at line 216 of file cfl_types.cpp.
void faudes::Type::XWrite | ( | const Type * | pContext = 0 |
) | const |
Write configuration data in XML format to TokenWriter.
Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes. No DOCTYPE markup will be written.
pContext | Write context to provide contextual information |
Definition at line 190 of file cfl_types.cpp.
void faudes::Type::XWrite | ( | const std::string & | pFileName, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [virtual] |
Write configuration data to an XML file.
Note: this method uses the faudes type to set a DOCTYPE markup; for derived classes which do not report their faudes type, you should reimplement this function. Actual token io is done via DoXWrite().
pFileName | Name of file | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Definition at line 197 of file cfl_types.cpp.
std::string faudes::Type::msStringEmpty [static, private] |
Definition at line 845 of file cfl_types.h.
std::string faudes::Type::msStringVoid [static, private] |
Definition at line 844 of file cfl_types.h.
libFAUDES 2.18b --- 2010-12-17 --- c++ source docu by doxygen 1.6.3