| |
libFAUDES
Sections
Index
|
faudes::NameSet Class Reference |
Public Member Functions | |
NameSet (void) | |
Constructor for NameSet referring to the static SymbolTable. | |
NameSet (const NameSet &rOtherSet) | |
Copy-constructor from other NameSet. | |
NameSet (const std::string &rFilename, const std::string &rLabel="NameSet") | |
Constructor from file. | |
virtual NameSet * | New () const |
Return a pointer to a NameSet with same Symboltable assigned. | |
NameSet | NewN () const |
Return an empty NameSet with same SymbolTable as this set. | |
virtual NameSet & | operator= (const NameSet &rSrc) |
Assignment operator (uses Copy). | |
virtual void | Copy (NameSet &rOtherSet) const |
Copy to other name set. | |
virtual void | CopyWithoutAttributes (NameSet &rOtherSet) const |
Copy name set. | |
SymbolTable * | SymbolTablep (void) const |
Get Pointer mpSymbolTable. | |
void | SymbolTablep (SymbolTable *pSymTab) |
Set SymbolTable reference. | |
bool | Insert (Idx index) |
Add an element by index. | |
Idx | Insert (const std::string &rName) |
Add an element by its symbolic name. | |
void | InsertSet (const NameSet &rOtherSet) |
Inserts elements of rOtherSet. | |
virtual bool | Erase (Idx index) |
Delete element by index. | |
virtual bool | Erase (const std::string &rName) |
Delete element by symbolic name. | |
virtual Iterator | Erase (const Iterator &pos) |
Delete element by iterator. | |
void | EraseSet (const NameSet &rOtherSet) |
Erase elements specified by rOtherSet. | |
void | RestrictSet (const NameSet &rOtherSet) |
Restrict elements specified by rOtherSet. | |
void | SymbolicName (Idx index, const std::string &rName) |
Set new name for existing index. | |
void | SymbolicName (const std::string &rName, const std::string &rNewName) |
Set new name for existing name FAUDES_CHECKED checks if the specified name exists in NameSet. | |
std::string | SymbolicName (Idx index) const |
Name lookup. | |
Idx | Index (const std::string &rName) const |
Index lookup. | |
bool | Exists (Idx index) const |
Test existence of index. | |
bool | Exists (const std::string &rName) const |
Test existence of name. | |
NameSet::Iterator | Find (Idx index) const |
Find iterator for index. | |
NameSet::Iterator | Find (const std::string &rName) const |
Find iterator for name. | |
virtual void | Attributes (const NameSet &rOtherSet) |
Set attributes. | |
NameSet | operator+ (const NameSet &rOtherSet) const |
Set union operator. | |
NameSet | operator- (const NameSet &rOtherSet) const |
Set difference operator. | |
NameSet | operator* (const NameSet &rOtherSet) const |
Set intersection operator. | |
bool | operator== (const NameSet &rOtherSet) const |
Test for equality. | |
bool | operator!= (const NameSet &rOtherSet) const |
Test for unequality. | |
bool | operator<= (const NameSet &rOtherSet) const |
Test for subset. | |
bool | operator>= (const NameSet &rOtherSet) const |
Test for superset. | |
std::string | Str (Idx index) const |
Return pretty printable symbolic name for index. | |
Protected Member Functions | |
virtual void | DoWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see Type::Write for public wrappers. | |
virtual void | DoDWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const |
Write debug info to TokenWriter, see Type::DWrite for public wrapper. | |
virtual void | DoRead (TokenReader &tr, const std::string &rLabel="", const Type *pContext=0) |
Read from TokenReader, see Type::Read for public wrappers. | |
Protected Attributes | |
SymbolTable * | mpSymbolTable |
Pointer to local SymbolTable. | |
Friends | |
class | TaNameSet |
We implement "protected privacy for template classes" by friendship. |
faudes::NameSet::NameSet | ( | void | ) |
Constructor for NameSet referring to the static SymbolTable.
faudes::NameSet::NameSet | ( | const NameSet & | rOtherSet | ) |
Copy-constructor from other NameSet.
This also copies the SymbolTable reference, hence the new NameSet will use the same SymbolTable as rOtherSet.
rOtherSet | Set to copy |
faudes::NameSet::NameSet | ( | const std::string & | rFilename, | |
const std::string & | rLabel = "NameSet" | |||
) |
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.
rFilename | Name of file | |
rLabel | Section for the set in the file; |
NameSet * faudes::NameSet::New | ( | void | ) | const [virtual] |
Return a pointer to a NameSet with same Symboltable assigned.
Reimplemented from faudes::IndexSet.
Reimplemented in faudes::TaNameSet< Attr >, faudes::ClockSet, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
NameSet faudes::NameSet::NewN | ( | void | ) | const |
Return an empty NameSet with same SymbolTable as this set.
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
Assignment operator (uses Copy).
rSrc | Source from which to assign |
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::Copy | ( | NameSet & | rOtherSet | ) | const [virtual] |
Copy to other name set.
Performs a fake copy, see TBaseSet. This function maintains attributes if types can be casted.
rOtherSet | Destination to copy to |
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::CopyWithoutAttributes | ( | NameSet & | rOtherSet | ) | const [virtual] |
Copy name set.
Performs a fake copy, see TBaseSet. This function sets attributes to default.
rOtherSet | Destination to copy to |
SymbolTable * faudes::NameSet::SymbolTablep | ( | void | ) | const |
Get Pointer mpSymbolTable.
void faudes::NameSet::SymbolTablep | ( | SymbolTable * | pSymTab | ) |
Set SymbolTable reference.
This function sets the reference to the SymbolTable. The current implementation clears the set, future versions may implement a re-indexing.
pSymTab | Pointer to SymbolTable |
bool faudes::NameSet::Insert | ( | Idx | index | ) |
Add an element by index.
Index must be already known to the global SymbolTable.
index | Index to add |
Exception |
|
Reimplemented from faudes::IndexSet.
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
Idx faudes::NameSet::Insert | ( | const std::string & | rName | ) |
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.
rName | Symbolic name of element to add |
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::InsertSet | ( | const NameSet & | rOtherSet | ) |
Inserts elements of rOtherSet.
rOtherSet | Other NameSet |
Exception |
|
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
bool faudes::NameSet::Erase | ( | Idx | index | ) | [virtual] |
Delete element by index.
The symbolic name is not removed from the SymbolTable.
index | Index |
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
bool faudes::NameSet::Erase | ( | const std::string & | rName | ) | [virtual] |
Delete element by symbolic name.
The symbolic name is not removed from the SymbolTable
rName | symbolic name |
Exception |
|
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
NameSet::Iterator faudes::NameSet::Erase | ( | const Iterator & | pos | ) | [virtual] |
Delete element by iterator.
Symbolic nam is not removed from SymbolTable.
pos | NameSet::iterator |
Exception |
|
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::EraseSet | ( | const NameSet & | rOtherSet | ) |
Erase elements specified by rOtherSet.
rOtherSet | Other StateSet |
Exception |
|
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::RestrictSet | ( | const NameSet & | rOtherSet | ) |
Restrict elements specified by rOtherSet.
rOtherSet | Other StateSet |
Exception |
|
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::SymbolicName | ( | Idx | index, | |
const std::string & | rName | |||
) |
Set new name for existing index.
FAUDES_CHECKED checks if index exists in NameSet.
index | Index to edit | |
rName | New name |
Exception |
|
void faudes::NameSet::SymbolicName | ( | const std::string & | rName, | |
const std::string & | rNewName | |||
) |
std::string faudes::NameSet::SymbolicName | ( | Idx | index | ) | const |
Name lookup.
index | Index to lookup |
Idx faudes::NameSet::Index | ( | const std::string & | rName | ) | const |
Index lookup.
rName | Symbolic name to look up |
bool faudes::NameSet::Exists | ( | Idx | index | ) | const |
Test existence of index.
index | Index to test |
bool faudes::NameSet::Exists | ( | const std::string & | rName | ) | const |
Test existence of name.
rName | Symbolic name to test |
NameSet::Iterator faudes::NameSet::Find | ( | Idx | index | ) | const |
Find iterator for index.
Returns either a valid iterator or End() for non-existent.
index | Index to find |
NameSet::Iterator faudes::NameSet::Find | ( | const std::string & | rName | ) | const |
Find iterator for name.
Returns either a valid iterator or End() for non-existent.
rName | Name to find |
virtual void faudes::NameSet::Attributes | ( | const NameSet & | rOtherSet | ) | [inline, virtual] |
Set attributes.
This virtual interface function in overloaded by the derived class TaNameSet to set attributes by the specified set. Since the plain NameSet has no attributes, this function does nothing.
rOtherSet | Other NameSet |
Exception |
|
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
bool faudes::NameSet::operator== | ( | const NameSet & | rOtherSet | ) | const |
Test for equality.
bool faudes::NameSet::operator!= | ( | const NameSet & | rOtherSet | ) | const |
Test for unequality.
bool faudes::NameSet::operator<= | ( | const NameSet & | rOtherSet | ) | const |
Test for subset.
bool faudes::NameSet::operator>= | ( | const NameSet & | rOtherSet | ) | const |
Test for superset.
std::string faudes::NameSet::Str | ( | Idx | index | ) | const |
Return pretty printable symbolic name for index.
Primary meant for debugging messages.
index | Index to print |
Reimplemented from faudes::IndexSet.
Reimplemented in faudes::TaNameSet< Attr >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::NameSet::DoWrite | ( | TokenWriter & | tw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write to TokenWriter, see Type::Write for public wrappers.
tw | Reference to TokenWriter | |
rLabel | Label of the section to write, defaults to name of set or "NameSet" | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::IndexSet.
void faudes::NameSet::DoDWrite | ( | TokenWriter & | tw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write debug info to TokenWriter, see Type::DWrite for public wrapper.
The debug version writes a format that includes symbolic names and indices.
tw | Reference to TokenWriter | |
rLabel | Label of the section to write, defaults to name of set or "NameSet" | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::TBaseSet< T, Cmp >.
void faudes::NameSet::DoRead | ( | TokenReader & | tr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Read from TokenReader, see Type::Read for public wrappers.
Uses TaNameSet::DoRead(TokenReader&,const std::string&) with void attributes. It is an error if the file contains an index (id 52).
tr | Reference to TokenReader | |
rLabel | Label to read, defaults to "NameSet" | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::IndexSet.
friend class TaNameSet [friend] |
We implement "protected privacy for template classes" by friendship.
This is used for the pragmatic implemention conversion constructors.
SymbolTable* faudes::NameSet::mpSymbolTable [protected] |
Pointer to local SymbolTable.
libFAUDES 2.13a c++ source docu by doxygen 1.5.6