Detailed Description

This class extends the base Type by common features worthwhile for "large objects", e.g., object name, a cache for the regsitry record and convenience access wrappers.

Definition at line 1110 of file cfl_types.h.

#include <cfl_types.h>

Public Member Functions

 ExtType (void)
 
 ExtType (const ExtType &rType)
 
virtual ~ExtType (void)
 
const std::string & Name (void) const
 
void Name (const std::string &rName)
 
virtual const std::string & TypeName (void) const
 
virtual void TypeName (const std::string &rType)
 
virtual const std::string & ElementTag (void) const
 
virtual void ElementTag (const std::string &rTag)
 
virtual const std::string & ElementType (void) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
Typeoperator= (const Type &rSrc)
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
- Public Member Functions inherited from faudes::AttrType
 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
 
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)
 

Protected Attributes

std::string mElementType
 
std::string mElementTagDef
 
std::string mObjectName
 

Private Attributes

const TypeDefinitionpTypeDefinition
 
std::string mFaudesTypeName
 
std::string mElementTag
 

Additional Inherited Members

- Static Public Member Functions inherited from faudes::AttrType
static void Skip (TokenReader &rTr)
 
- Protected Member Functions inherited from faudes::AttrType
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 Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Constructor & Destructor Documentation

◆ ExtType() [1/2]

faudes::ExtType::ExtType ( void  )

Constructor

Definition at line 413 of file cfl_types.cpp.

◆ ExtType() [2/2]

faudes::ExtType::ExtType ( const ExtType rType)

Copy constructor

Definition at line 416 of file cfl_types.cpp.

◆ ~ExtType()

faudes::ExtType::~ExtType ( void  )
virtual

Destructor

Definition at line 419 of file cfl_types.cpp.

Member Function Documentation

◆ ElementTag() [1/2]

void faudes::ExtType::ElementTag ( const std::string &  rTag)
virtual

Configure the element name tag.

This method allows to overwrite the tag used for elements in XML IO. For usual, you will register derived classes with the run-time-interface and set the elemen tag for XML IO.

Parameters
rTagTag to set

Definition at line 476 of file cfl_types.cpp.

◆ ElementTag() [2/2]

const std::string & faudes::ExtType::ElementTag ( void  ) const
virtual

Get the element name tag.

Tags used for XML IO when eriting elements of a container class. This is either the deribeved class default of found in the registry.

Returns
Tag

Definition at line 459 of file cfl_types.cpp.

◆ ElementType()

const std::string & faudes::ExtType::ElementType ( void  ) const
virtual

Get the element type.

This should be found in the registry.

Returns
Tag

Definition at line 482 of file cfl_types.cpp.

◆ Name() [1/2]

void faudes::ExtType::Name ( const std::string &  rName)
virtual

Set objects name

Parameters
rNameName to set

Reimplemented from faudes::Type.

Definition at line 427 of file cfl_types.cpp.

◆ Name() [2/2]

const std::string & faudes::ExtType::Name ( void  ) const
virtual

Get objects name

Returns
Name

Reimplemented from faudes::Type.

Reimplemented in faudes::Executor.

Definition at line 422 of file cfl_types.cpp.

◆ 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 1064 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 1062 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 1063 of file cfl_types.cpp.

◆ TypeDefinitionp()

const TypeDefinition * faudes::ExtType::TypeDefinitionp ( void  ) const
virtual

Get registry record

Returns nullptr if not registered

Returns
Pointer to registry entry

Reimplemented from faudes::Type.

Definition at line 433 of file cfl_types.cpp.

◆ TypeName() [1/2]

void faudes::ExtType::TypeName ( const std::string &  rType)
virtual

Overwrite faudes-type name.

This method is used to overwrite the faudes-type identifyer to account for unregistered classe/

Parameters
rTypeFaudes-type name to set

Definition at line 454 of file cfl_types.cpp.

◆ TypeName() [2/2]

const std::string & faudes::ExtType::TypeName ( void  ) const
virtual

Get objects's type name.

Retrieve the faudes-type name from the type registry.

Returns
Faudes-type name or empty string.

Reimplemented from faudes::Type.

Definition at line 443 of file cfl_types.cpp.

Member Data Documentation

◆ mElementTag

std::string faudes::ExtType::mElementTag
private

Current/cached name of elements (use protected accessor methods for caching)

Definition at line 1222 of file cfl_types.h.

◆ mElementTagDef

std::string faudes::ExtType::mElementTagDef
protected

Defauft name of elements (if not over written manually or by registry)

Definition at line 1230 of file cfl_types.h.

◆ mElementType

std::string faudes::ExtType::mElementType
protected

Current/cached name of elements (use protected accessor methods for caching)

Definition at line 1227 of file cfl_types.h.

◆ mFaudesTypeName

std::string faudes::ExtType::mFaudesTypeName
private

Current/cached faudes type-name

Definition at line 1219 of file cfl_types.h.

◆ mObjectName

std::string faudes::ExtType::mObjectName
protected

object name

Definition at line 1233 of file cfl_types.h.

◆ pTypeDefinition

const TypeDefinition* faudes::ExtType::pTypeDefinition
private

TypeDefinition cache (should use guarded pointer here)

Definition at line 1216 of file cfl_types.h.


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

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