libFAUDES

Sections

Index

faudes::Type Class Reference
[Run-Time Interface]

#include <rtitypes.h>

Inherited by faudes::AttributeVoid, faudes::Boolean, faudes::Documentation, faudes::EventRelabelMap, faudes::Function, faudes::FunctionRegistry, faudes::Integer, faudes::ParallelExecutor, faudes::ParallelExecutor::ParallelTimedState, faudes::Signature, faudes::String, faudes::SymbolTable, faudes::TBaseSet< T, Cmp >, faudes::TypeRegistry, faudes::vGenerator, faudes::TBaseSet< faudes::Transition, Cmp >, faudes::TBaseSet< faudes::Transition, faudes::TransSort::EvX2X1 >, faudes::TBaseSet< faudes::Transition, faudes::TransSort::X1EvX2 >, faudes::TBaseSet< long unsigned int >, and faudes::TBaseSet< std::string >.

List of all members.


Detailed Description

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 IO interface for derived classes that is intended to read and write the objects configuration to/from faudes token streams. It also declares the virtual function New() to construct an object of identical type on heap and the virtual function Cast(pOther) to dynamically cast another object to this type. The latter two functions support the run-time interface and must be reimplemented in derived classes by the macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.

Public Member Functions

 Type (void)
 Constructor.
 Type (const Type &rType)
 Copy constructor.
virtual ~Type (void)
 Destructor.
virtual TypeNew (void) const
 Construct on heap.
virtual const TypeCast (const Type *pOther) const
 Cast other object to this type.
virtual void Clear (void)
 Clear configuration data.
virtual TypeAssign (const Type &rSrc)
 Assign configurationdata from other object.
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.
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a 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 to TokenWriter, debugging format.
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 TypeDoAssign (const Type &rSrc)
 Assign configuration data from other object.
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 DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debugging format to TokenWriter.


Constructor & Destructor Documentation

faudes::Type::Type ( void   ) 

Constructor.

faudes::Type::Type ( const Type rType  ) 

Copy constructor.

faudes::Type::~Type ( void   )  [virtual]

Destructor.


Member Function Documentation

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.

Returns:
Pointer to new Type object

Reimplemented in faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::AttributeVoid, faudes::AttributeFlags, faudes::TBaseSet< T, Cmp >, faudes::AttributeCFlags, faudes::TcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::IndexSet, faudes::TaIndexSet< Attr >, faudes::NameSet, faudes::TaNameSet< Attr >, faudes::Function, faudes::Integer, faudes::String, faudes::Boolean, faudes::TSimpleFunction1< FTYPE0, CFNCT >, faudes::TSimpleFunction2< FTYPE0, FTYPE1, CFNCT >, faudes::TSimpleFunction3< FTYPE0, FTYPE1, FTYPE2, CFNCT >, faudes::TNestedFunction< FTYPE, CFNCT >, faudes::TTransSet< Cmp >, faudes::TaTransSet< Attr >, faudes::vGenerator, faudes::EventRelabelMap, faudes::HioEventFlags, faudes::HioStateFlags, 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::AttributeColoredState, faudes::AttributeTimedTrans, faudes::AttributeTimedState, faudes::AttributeTimedGlobal, faudes::TtGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >, faudes::ClockSet, faudes::SimConditionAttribute, faudes::SimEventAttribute, faudes::TaGenerator< faudes::AttributeTimedGlobal, faudes::AttributeTimedState, faudes::AttributeCFlags, faudes::AttributeTimedTrans >, faudes::TaGenerator< faudes::AttributeVoid, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeVoid >, faudes::TBaseSet< std::string >, faudes::TBaseSet< long unsigned int >, faudes::TBaseSet< faudes::Transition, faudes::TransSort::EvX2X1 >, faudes::TBaseSet< faudes::Transition, Cmp >, faudes::TBaseSet< faudes::Transition, faudes::TransSort::X1EvX2 >, faudes::TcGenerator< faudes::AttributeTimedGlobal, faudes::AttributeTimedState, faudes::AttributeCFlags, faudes::AttributeTimedTrans >, faudes::TaIndexSet< faudes::HioEventFlags >, faudes::TaIndexSet< faudes::SimConditionAttribute >, faudes::TaIndexSet< faudes::AttributeTimedState >, faudes::TaIndexSet< faudes::SimEventAttribute >, faudes::TaIndexSet< faudes::HioStateFlags >, faudes::TaIndexSet< StateAttr >, faudes::TaIndexSet< EventAttr >, faudes::TaIndexSet< faudes::AttributeCFlags >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, faudes::TaNameSet< faudes::AttributeCFlags >, faudes::TTransSet< faudes::TransSort::EvX2X1 >, faudes::TTransSet< faudes::TransSort::X1EvX2 >, faudes::THioConstraint< faudes::AttributeVoid, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeVoid >, faudes::THioController< faudes::AttributeVoid, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeVoid >, faudes::THioEnvironment< faudes::AttributeVoid, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeVoid >, faudes::THioPlant< faudes::AttributeVoid, faudes::HioStateFlags, faudes::HioEventFlags, faudes::AttributeVoid >, and faudes::TtGenerator< faudes::AttributeTimedGlobal, faudes::AttributeTimedState, faudes::AttributeCFlags, faudes::AttributeTimedTrans >.

const Type * faudes::Type::Cast ( const Type pOther  )  const [virtual]

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.

Returns:
Typed pointer object

Reimplemented in faudes::AttributeVoid, faudes::AttributeFlags, and faudes::AttributeCFlags.

Type & faudes::Type::Assign ( const Type rSrc  )  [virtual]

Assign configurationdata from other object.

Note: this function call virtual clear and then uses DoAssign to copy the member variables of this class.

Parameters:
rSrc Source to copy from
Returns:
Reference to this object.

void faudes::Type::Write ( const Type pContext = 0  )  const

Write configuration data to console.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived classes.

Parameters:
pContext Write context to provide contextual information

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: all write functions use the virtual function DoWrite(), to be reimplemented by derived classes.

Parameters:
pFileName Name of file
rLabel Label of section to write
pContext Write context to provide contextual information
openmode ios::openmode
Exceptions:
Exception 
  • IO errors (id 2)

void faudes::Type::Write ( const std::string &  pFileName,
std::ios::openmode  openmode 
) const

Write configuration data to a file.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived classes.

Parameters:
pFileName Name of file
openmode ios::openmode
Exceptions:
Exception 
  • IO errors (id 2)

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

Write configuration data to TokenWriter.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived classes.

Parameters:
rTw Reference to TokenWriter
rLabel Label of section to write
pContext Write context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 2)

std::string faudes::Type::ToString ( const std::string &  rLabel = "",
const Type pContext = 0 
) const

Write configuration data to a string.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived classes.

Parameters:
rLabel Label of section to write
pContext Write context to provide contextual information
Returns:
output string
Exceptions:
Exception 
  • IO errors (id 2)

void faudes::Type::DWrite ( const Type pContext = 0  )  const

Write configuration data to console, debugging format.

Note: all write functions use the virtual function DoDWrite(), to be reimplemented by derived classes.

Parameters:
pContext Write context to provide contextual information

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: all write functions use the virtual function DoDWrite(), to be reimplemented by derived classes.

Parameters:
pFileName Name of file
rLabel Label of section to write
pContext Write context to provide contextual information
openmode ios::openmode
Exceptions:
Exception 
  • IO errors (id 2)

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

Write configuration data to TokenWriter, debugging format.

Note: all write functions use the virtual function DoDWrite(), to be reimplemented by derived classes.

Parameters:
rTw Reference to TokenWriter
rLabel Label of section to write
pContext Write context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 2)

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.

Parameters:
rFileName Name of file
rLabel Section to read from
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 1)
  • token mismatch from DoRead()

void faudes::Type::FromString ( const std::string &  rString,
const std::string &  rLabel = "",
const Type pContext = 0 
)

Write configuration data to a string.

Note: all write functions use the virtual function DoWrite(), to be reimplemented by derived classes.

Parameters:
rString String to read from
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 1)
  • token mismatch from DoRead()

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.

Parameters:
rTr Reference to tokenreader
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 1)
  • token mismatch from DoRead()

Type & 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.

Parameters:
rSrc Source to copy from
Returns:
Reference to this object.

void faudes::Type::DoWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const [protected, virtual]

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.

Parameters:
rTw Reference to TokenWriter
rLabel Label of section to write
pContext Write context to provide contextual information
Exceptions:
Exception 
  • IO errors (id 2)

Reimplemented in faudes::TBaseSet< T, Cmp >, faudes::NameSet, faudes::vGenerator, faudes::TBaseSet< std::string >, faudes::TBaseSet< long unsigned int >, faudes::TBaseSet< faudes::Transition, faudes::TransSort::EvX2X1 >, faudes::TBaseSet< faudes::Transition, Cmp >, and faudes::TBaseSet< faudes::Transition, faudes::TransSort::X1EvX2 >.


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

libFAUDES 2.13a c++ source docu by doxygen 1.5.6