| |
libFAUDES
Sections
Index
|
faudes::TypeDefinition Class Reference |
Public Member Functions | |
TypeDefinition (const std::string &name="") | |
Constructor. | |
virtual | ~TypeDefinition (void) |
Destructor. | |
const Type * | Prototype (void) const |
Return pointer to faudes-object prototype. | |
Type * | NewObject (void) const |
Construct faudes-object on heap. | |
void | MergeDocumentationBody (TokenReader &rTr) |
Merge documentation and from token stream. | |
Static Public Member Functions | |
template<class T> | |
static TypeDefinition * | Constructor (const std::string &rTypeName="") |
Construct empty TypeDefinition object. | |
static TypeDefinition * | Constructor (Type *pProto, const std::string &rTypeName="") |
Construct empty TypeDefinition object. | |
template<class T> | |
static TypeDefinition * | FromFile (const std::string &rFileName) |
Construct TypeDefinition object and read name and documentation-data from TokenReader. | |
Protected Member Functions | |
TypeDefinition (const TypeDefinition &rOther) | |
Disable copy constructor. | |
void | Clear (void) |
Clear documentation-data; do *NOT* delete prototype (this is for using Read to merge/overwrite documentation). | |
void | Prototype (Type *pType) |
Use given object as prototype. | |
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. | |
Protected Attributes | |
Type * | mpType |
Type-pointer to store address of libFAUDES-Type instance. |
faudes::TypeDefinition::TypeDefinition | ( | const std::string & | name = "" |
) | [inline] |
Constructor.
The default constructor instantiates an invalid type definition without prototype. To construct a valid type definition, use the static Constructor() template function.
virtual faudes::TypeDefinition::~TypeDefinition | ( | void | ) | [inline, virtual] |
Destructor.
Delete prototype object.
faudes::TypeDefinition::TypeDefinition | ( | const TypeDefinition & | rOther | ) | [inline, protected] |
Disable copy constructor.
TypeDefinition * faudes::TypeDefinition::Constructor | ( | const std::string & | rTypeName = "" |
) | [inline, static] |
Construct empty TypeDefinition object.
The given template parameter denotes any libFAUDES class derived from faudes::Type A new instance of this class is assigned to member variable (pType) whereas the name is set as specified.
T | Actual c class, derived from Type |
rTypeName | Name to identify this faudes-type<; defaults to the plattform dependand typeid from the c++ runtime type information system. |
TypeDefinition * faudes::TypeDefinition::Constructor | ( | Type * | pProto, | |
const std::string & | rTypeName = "" | |||
) | [static] |
Construct empty TypeDefinition object.
The given prototype is assigned to the member variable pType,
pProto | Prototype, derived from Type | |
rTypeName | Name to identify this faudes-type<; defaults to the plattform dependand typeid from the c++ runtime type information system. |
TypeDefinition * faudes::TypeDefinition::FromFile | ( | const std::string & | rFileName | ) | [inline, static] |
Construct TypeDefinition object and read name and documentation-data from TokenReader.
T | Actual c class, derived from Type |
rFileName | Name of file to read. |
const Type * faudes::TypeDefinition::Prototype | ( | void | ) | const |
Return pointer to faudes-object prototype.
Note: this method is meant for inspection only, control over the prototype remains with the TypeDefinition. Use NewObject() to instantiate a new faudes-object.
Type * faudes::TypeDefinition::NewObject | ( | void | ) | const |
void faudes::TypeDefinition::MergeDocumentationBody | ( | TokenReader & | rTr | ) |
Merge documentation and from token stream.
This member reads the body of the TypeDefinition token format and sets the documentation and accordingly. An exception is thrown if the current type name differs from the one in the documentation.
rTr | TokenReader to read from. |
void faudes::TypeDefinition::Clear | ( | void | ) | [protected, virtual] |
Clear documentation-data; do *NOT* delete prototype (this is for using Read to merge/overwrite documentation).
Reimplemented from faudes::Documentation.
void faudes::TypeDefinition::Prototype | ( | faudes::Type * | pType | ) | [protected] |
Use given object as prototype.
The TypeDefinition takes ownership of the provided object.
pType | Any class that inherits Type. |
void faudes::TypeDefinition::DoRead | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Read configuration data of this object from TokenReader.
The section is hardcode to "TypeDefinition", context ignored.
rTr | TokenReader to read from | |
rLabel | Section to read | |
pContext | Read context to provide contextual information (ignored) |
Exception |
|
Reimplemented from faudes::Documentation.
void faudes::TypeDefinition::DoWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write configuration data of this object to TokenWriter.
The section is hardcode to "TypeDefinition", context ignored.
rTw | Reference to TokenWriter | |
rLabel | Label of section to write | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::Documentation.
Type* faudes::TypeDefinition::mpType [protected] |
Type-pointer to store address of libFAUDES-Type instance.
libFAUDES 2.13a c++ source docu by doxygen 1.5.6