faudes::SymbolSet Class Reference
|
Public Types | |
typedef TBaseSet< std::string > ::Iterator | Iterator |
Iterators on indexset. | |
Public Member Functions | |
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 void | 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. |
Set of symbols.
The class is built on top of the faudes version TBaseSet of STL sets. It provides the essentials of the STL interface and plus token based file IO. Invalid iterators throw an exception (id 62) when used as an argument to a SymbolSet function. If the macro FAUDES_CHECKED is defined, the attempt to insert an invalid symbol an exception (id 61).
Note that a symbol set holds a plain set of valid faudes symbols with no indices or symboltable associated. If you are looking for a set of items with mandatory symbolic names you most likely are better of with a NameSet or a TaNameSet. Currently, there is no attributed version of a SymbolSet.
The token IO format is demonstrated by the following example of a set with name "MySymbols"
<MySymbols> "ASymbol" "AnotherSymbol" </MySymbols>
Note that you can read SymbolSet files to NameSets and vice versa.
Definition at line 68 of file cfl_symbolset.h.
typedef TBaseSet<std::string>::Iterator faudes::SymbolSet::Iterator |
Iterators on indexset.
Definition at line 116 of file cfl_symbolset.h.
faudes::SymbolSet::SymbolSet | ( | void | ) |
Constructor.
Definition at line 32 of file cfl_symbolset.cpp.
faudes::SymbolSet::SymbolSet | ( | const TBaseSet< std::string > & | rOtherSet | ) |
Copy-constructor.
Definition at line 40 of file cfl_symbolset.cpp.
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 cfl_symbolset.cpp.
virtual faudes::SymbolSet::~SymbolSet | ( | void | ) | [inline, virtual] |
Virtual destructor.
Definition at line 102 of file cfl_symbolset.h.
void faudes::SymbolSet::DoAssign | ( | const SymbolSet & | rSource | ) | [protected, virtual] |
Assign my members.
This method calls the base class to assign its members.
rSource | Source to copy from |
Definition at line 55 of file cfl_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 76 of file cfl_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 61 of file cfl_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 101 of file cfl_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 cfl_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 cfl_symbolset.h.
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 107 of file cfl_symbolset.cpp.
libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen