| |
libFAUDES
Sections
Index
|
faudes::SymbolSet Class Reference |
Public Types | |
typedef TBaseSet< std::string > ::Iterator | Iterator |
Iterators on indexset. | |
Public Member Functions | |
virtual SymbolSet * | New (void) const |
Construct on heap. | |
virtual SymbolSet * | Copy (void) const |
Construct on heap. | |
virtual const SymbolSet * | Cast (const Type *pOther) const |
Cast other object to this type. | |
virtual SymbolSet & | Assign (const Type &rSrc) |
Assign configuration data from other object. | |
virtual bool | Equal (const Type &rOther) const |
Test equality of configuration data. | |
virtual SymbolSet & | operator= (const SymbolSet &rSrc) |
virtual bool | operator== (const SymbolSet &rOther) const |
virtual bool | operator!= (const SymbolSet &rOther) const |
SymbolSet (void) | |
Constructor. | |
SymbolSet (const TBaseSet< std::string > &rOtherSet) | |
Copy-constructor. | |
SymbolSet (const std::string &rFilename, const std::string &rLabel="SymbolSet") | |
Construct from file. | |
virtual | ~SymbolSet (void) |
Virtual destructor. | |
bool | Valid (const std::string &symbol) const |
Test whether the given string is a valid faudes symbol. | |
bool | Insert (const std::string &symbol) |
Insert specified symbol. | |
Idx | Signature (void) const |
Compute an Idx type signature for a Set. | |
std::string | Str (const std::string &symbol) const |
Return pretty printable symbol. | |
Protected Member Functions | |
virtual SymbolSet & | DoAssign (const SymbolSet &rSource) |
Assign my members. | |
void | DoWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see TBaseSet for public wrappers. | |
void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Read from TokenReader, see TBaseSet for public wrappers. |
typedef TBaseSet<std::string>::Iterator faudes::SymbolSet::Iterator |
faudes::SymbolSet::SymbolSet | ( | void | ) |
faudes::SymbolSet::SymbolSet | ( | const TBaseSet< std::string > & | rOtherSet | ) |
faudes::SymbolSet::SymbolSet | ( | const std::string & | rFilename, | |
const std::string & | rLabel = "SymbolSet" | |||
) |
Construct from file.
Uses the Read(TokenReader&, const std::string&) function to read. a SymbolSet from section rLabel in file rFilename.
rFilename | Name of file to read | |
rLabel | Section to read |
Exception |
|
Definition at line 47 of file symbolset.cpp.
virtual faudes::SymbolSet::~SymbolSet | ( | void | ) | [inline, virtual] |
SymbolSet * faudes::SymbolSet::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 from faudes::TBaseSet< std::string >.
Definition at line 28 of file symbolset.cpp.
SymbolSet * faudes::SymbolSet::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 from faudes::TBaseSet< std::string >.
Definition at line 28 of file symbolset.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 from faudes::TBaseSet< std::string >.
Definition at line 28 of file symbolset.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 downcatsted 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 from faudes::TBaseSet< std::string >.
Definition at line 28 of file symbolset.cpp.
bool faudes::SymbolSet::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 is not consired 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 objevt to compare with. |
Reimplemented from faudes::TBaseSet< std::string >.
Definition at line 28 of file symbolset.cpp.
Definition at line 28 of file symbolset.cpp.
bool faudes::SymbolSet::operator== | ( | const SymbolSet & | rOther | ) | const [virtual] |
Definition at line 28 of file symbolset.cpp.
bool faudes::SymbolSet::operator!= | ( | const SymbolSet & | rOther | ) | const [virtual] |
Definition at line 28 of file symbolset.cpp.
bool faudes::SymbolSet::Valid | ( | const std::string & | symbol | ) | const [virtual] |
Test whether the given string is a valid faudes symbol.
symbol | Symbol to test |
Reimplemented from faudes::TBaseSet< std::string >.
Definition at line 108 of file symbolset.cpp.
bool faudes::SymbolSet::Insert | ( | const std::string & | symbol | ) | [virtual] |
Insert specified symbol.
symbol | Symbol to insert |
Reimplemented from faudes::TBaseSet< std::string >.
Definition at line 102 of file symbolset.cpp.
Idx faudes::SymbolSet::Signature | ( | void | ) | const [inline] |
Compute an Idx type signature for a Set.
This method is currently not implemented.
Definition at line 135 of file symbolset.h.
std::string faudes::SymbolSet::Str | ( | const std::string & | symbol | ) | const [inline, virtual] |
Return pretty printable symbol.
symbol | Symbol to print |
Reimplemented from faudes::TBaseSet< std::string >.
Definition at line 146 of file symbolset.h.
Assign my members.
This method calls the base class to assign its members.
rSource | Source to copy from |
Definition at line 55 of file symbolset.cpp.
void faudes::SymbolSet::DoWrite | ( | TokenWriter & | tw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write to TokenWriter, see TBaseSet for public wrappers.
tw | Reference to TokenWriter | |
rLabel | Label of section to write, defaults to name of set | |
pContext | Write context for contextual information |
Exception |
|
Reimplemented from faudes::TBaseSet< std::string >.
Definition at line 62 of file symbolset.cpp.
void faudes::SymbolSet::DoRead | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Read from TokenReader, see TBaseSet for public wrappers.
rTr | Reference to tokenreader | |
rLabel | Section to read | |
pContext | Read context for contextual information |
Exception |
|
Reimplemented from faudes::TBaseSet< std::string >.
Definition at line 77 of file symbolset.cpp.
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6