#include <nameset.h>
Inheritance diagram for faudes::TaNameSet< Attr >:
This class is derived from NameSet and TaIndexSet to inherit both extra features on top of IndexSet.
The file format is demonstrated by the following example of a set "Alphabet" consisting of events "alpha", "beta" and "gamma" with "gamma" having some attribute (see eg AtributeFlags)
<Alphabet> "alpha" "beta" "gamma" 0x0f <\Alphabet>
Definition at line 463 of file nameset.h.
Public Member Functions | |
TaNameSet (void) | |
Constructor for NameSet referring to the static SymbolTable. | |
TaNameSet (const TaNameSet &rOtherSet) | |
Copy-constructor from other TaNameSet (incl attributes and symboltable). | |
TaNameSet (const NameSet &rOtherSet) | |
Constructor from NameSet (sets default attributes, same symboltable). | |
TaNameSet (const std::string &rFilename, const std::string &rLabel="NameSet") | |
Constructor from file. | |
virtual | ~TaNameSet (void) |
Virtual destructor. | |
TaNameSet | NewN () const |
Return a NameSet with same symboltable as this set. | |
TaNameSet * | NewP () const |
Return an empty NameSet with same SymbolTable as this set. | |
template<class OtherAttr> | |
void | CopyWithoutAttributes (TaNameSet< OtherAttr > &rOtherSet) const |
Copy this set to any nameset, ignore attributes. | |
bool | Insert (Idx index) |
Add an element by index. | |
bool | Insert (Idx index, const Attr &rAttr) |
Add an element by index incl. | |
Idx | Insert (const std::string &rName) |
Add an element by its symbolic name. | |
Idx | Insert (const std::string &rName, const Attr &rAttr) |
Add an element by its symbolic name. | |
void | InsertSet (const NameSet &rOtherSet) |
Inserts elements of rOtherSet. | |
void | InsertSet (const TaNameSet &rOtherSet) |
Inserts elements of rOtherSet incl attributes Attributes of this set are maintained, new elements are inserted with attribute. | |
bool | Erase (Idx index) |
Delete element by index. | |
bool | Erase (const std::string &rName) |
Delete element by symbolic name. | |
Iterator | Erase (const Iterator &pos) |
Delete element by iterator. | |
void | EraseSet (const NameSet &rOtherSet) |
Erase elements indicated by rOtherSet. | |
void | EraseSet (const TaNameSet &rOtherSet) |
Erase elements indicated by rOtherSet. | |
std::string | Str (Idx index) const |
Return pretty printable symbolic name for index. | |
Protected Member Functions | |
void | DoWrite (TokenWriter &tw, const std::string &rLabel) const |
Write to TokenWriter, see TBaseSet for public wrappers. | |
void | DoDWrite (TokenWriter &tw) const |
Write debug info to TokenWriter, see TBaseSet for public wrappers. | |
void | DoRead (TokenReader &tr, const std::string &rLabel="NameSet") |
Read from TokenReader, see TBaseSet for public wrappers. | |
Friends | |
class | TaNameSet |
We implement "protected privacy for template classes" by friendship. |
|
Constructor for NameSet referring to the static SymbolTable.
|
|
Copy-constructor from other TaNameSet (incl attributes and symboltable).
|
|
Constructor from NameSet (sets default attributes, same symboltable).
|
|
Constructor from file. This constructor reads a NameSet from a file using the DoRead(TokenReader&, const std::String&) function. The section is specified by rLabel and the static SymbolTable is used.
|
|
Virtual destructor.
|
|
Copy this set to any nameset, ignore attributes.
|
|
Write debug info to TokenWriter, see TBaseSet for public wrappers. The debug version writes a format that includes symbolic names and indices.
Reimplemented from faudes::NameSet. |
|
Read from TokenReader, see TBaseSet for public wrappers. It is an error if the file contains an index (id 52).
Reimplemented from faudes::TaIndexSet< Attr >. |
|
Write to TokenWriter, see TBaseSet for public wrappers.
Reimplemented from faudes::TaIndexSet< Attr >. |
|
Delete element by iterator. Symbolic nam is not removed from SymbolTable.
Reimplemented from faudes::TaIndexSet< Attr >. |
|
Delete element by symbolic name. Symbolic name is not removed from SymbolTable
Reimplemented from faudes::NameSet. |
|
Delete element by index. Symbolic name is not removed from SymbolTable.
Reimplemented from faudes::TaIndexSet< Attr >. |
|
Erase elements indicated by rOtherSet.
|
|
Erase elements indicated by rOtherSet.
Reimplemented from faudes::NameSet. |
|
Add an element by its symbolic name. If the name is unknown, a new index will be generated and recorded in the symboltable. If the name is known, the corresponding index will be added to the set.
|
|
Add an element by its symbolic name. If the name is unknown, a new index will be generated and recorded in the symboltable. If the name is known, the corresponding index will be added to the set. If the element already exists in the set, the attribute is maintained. Otherwise, the element is inserted with default attribute.
Reimplemented from faudes::NameSet. |
|
Add an element by index incl. attribute
Reimplemented from faudes::TaIndexSet< Attr >. |
|
Add an element by index. Index must be already known to the global SymbolTable. If the element already exists in the set, the attribute is maintained. Otherwise, the element is inserted with default attribute.
Reimplemented from faudes::TaIndexSet< Attr >. |
|
Inserts elements of rOtherSet incl attributes Attributes of this set are maintained, new elements are inserted with attribute.
|
|
Inserts elements of rOtherSet. Attributes of this set are maintained, newly inserted elements have default attribute.
Reimplemented from faudes::NameSet. |
|
Return a NameSet with same symboltable as this set.
Reimplemented from faudes::NameSet. |
|
Return an empty NameSet with same SymbolTable as this set.
Reimplemented from faudes::NameSet. |
|
Return pretty printable symbolic name for index. Primary meant for debugging messages.
Reimplemented from faudes::NameSet. |
|
We implement "protected privacy for template classes" by friendship. This is used for the pragmatic implemention conversion constructors. Reimplemented from faudes::NameSet. |