#include <symbolset.h>
Inheritance diagram for faudes::SymbolSet:
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>
Definition at line 68 of file symbolset.h.
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 | |
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. |
|
Iterators on indexset.
Definition at line 115 of file symbolset.h. |
|
Constructor.
Definition at line 28 of file symbolset.cpp. |
|
Copy-constructor.
Definition at line 36 of file symbolset.cpp. |
|
Construct from file. Uses the Read(TokenReader&, const std::string&) function to read. a SymbolSet from section rLabel in file rFilename.
Definition at line 43 of file symbolset.cpp. |
|
Virtual destructor.
Definition at line 101 of file symbolset.h. |
|
Read from TokenReader, see TBaseSet for public wrappers.
Reimplemented from faudes::TBaseSet< std::string >. Definition at line 66 of file symbolset.cpp. |
|
Write to TokenWriter, see TBaseSet for public wrappers.
Reimplemented from faudes::TBaseSet< std::string >. Definition at line 51 of file symbolset.cpp. |
|
Insert specified symbol.
Reimplemented from faudes::TBaseSet< std::string >. Definition at line 91 of file symbolset.cpp. |
|
Compute an Idx type signature for a Set. This method is currently not implemented.
Definition at line 134 of file symbolset.h. |
|
Return pretty printable symbol.
Definition at line 145 of file symbolset.h. |
|
Test whether the given string is a valid faudes symbol.
Reimplemented from faudes::TBaseSet< std::string >. Definition at line 97 of file symbolset.cpp. |