| |
libFAUDES
Sections
Index
|
faudes::IndexSet Class Reference |
Public Types | |
typedef TBaseSet< Idx >::Iterator | Iterator |
Iterators on indexset. | |
Public Member Functions | |
IndexSet (void) | |
Constructor. | |
IndexSet (const TBaseSet< Idx > &rOtherSet) | |
Copy-constructor. | |
IndexSet (const std::string &rFilename, const std::string &rLabel="IndexSet") | |
Construct from file. | |
virtual IndexSet * | New (void) const |
Construct on heap with same type. | |
virtual | ~IndexSet (void) |
Virtual destructor. | |
virtual void | Copy (IndexSet &rOtherSet) const |
Copy indexset. | |
virtual IndexSet & | operator= (const IndexSet &rSrc) |
Assignment operator (fake copy). | |
virtual void | CopyWithoutAttributes (IndexSet &rOtherSet) const |
Copy indexset. | |
Idx | MaxIndex (void) const |
Get maximum index used in this set (0 for emptyset). | |
bool | Valid (Idx index) const |
Test whether index is not 0. | |
Idx | Insert (void) |
Insert new index to set. | |
bool | Insert (Idx idx) |
Insert specified index. | |
Idx | Signature (void) const |
Compute an Idx type signature for a Set. | |
std::string | Str (Idx index) const |
Return pretty printable 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 | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Read from TokenReader, see Type::Read for public wrappers. | |
Friends | |
class | TaIndexSet |
We implement "protected privacy for template classes" by friendship. |
typedef TBaseSet<Idx>::Iterator faudes::IndexSet::Iterator |
Iterators on indexset.
faudes::IndexSet::IndexSet | ( | void | ) |
Constructor.
faudes::IndexSet::IndexSet | ( | const std::string & | rFilename, | |
const std::string & | rLabel = "IndexSet" | |||
) |
virtual faudes::IndexSet::~IndexSet | ( | void | ) | [inline, virtual] |
Virtual destructor.
IndexSet * faudes::IndexSet::New | ( | void | ) | const [virtual] |
Construct on heap with same type.
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::TaIndexSet< Attr >, faudes::NameSet, faudes::TaNameSet< Attr >, faudes::ClockSet, faudes::TaIndexSet< faudes::HioEventFlags >, faudes::TaIndexSet< faudes::SimConditionAttribute >, faudes::TaIndexSet< faudes::AttributeTimedState >, faudes::TaIndexSet< faudes::SimEventAttribute >, faudes::TaIndexSet< faudes::HioStateFlags >, faudes::TaIndexSet< StateAttr >, faudes::TaIndexSet< EventAttr >, faudes::TaIndexSet< faudes::AttributeCFlags >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
void faudes::IndexSet::Copy | ( | IndexSet & | rOtherSet | ) | const [virtual] |
Copy indexset.
Performs a fake copy, see TBaseSet. This function maintains attributes if types can be casted.
rOtherSet | Destination to copy to |
Reimplemented in faudes::TaIndexSet< Attr >, faudes::TaIndexSet< faudes::HioEventFlags >, faudes::TaIndexSet< faudes::SimConditionAttribute >, faudes::TaIndexSet< faudes::AttributeTimedState >, faudes::TaIndexSet< faudes::SimEventAttribute >, faudes::TaIndexSet< faudes::HioStateFlags >, faudes::TaIndexSet< StateAttr >, faudes::TaIndexSet< EventAttr >, and faudes::TaIndexSet< faudes::AttributeCFlags >.
Assignment operator (fake copy).
rSrc | Source from which to assign |
Reimplemented in faudes::TaIndexSet< Attr >, faudes::TaIndexSet< faudes::HioEventFlags >, faudes::TaIndexSet< faudes::SimConditionAttribute >, faudes::TaIndexSet< faudes::AttributeTimedState >, faudes::TaIndexSet< faudes::SimEventAttribute >, faudes::TaIndexSet< faudes::HioStateFlags >, faudes::TaIndexSet< StateAttr >, faudes::TaIndexSet< EventAttr >, and faudes::TaIndexSet< faudes::AttributeCFlags >.
void faudes::IndexSet::CopyWithoutAttributes | ( | IndexSet & | rOtherSet | ) | const [virtual] |
Copy indexset.
Performs a fake copy, see TBaseSet. This function sets attributes to default.
rOtherSet | Destination to copy to |
Idx faudes::IndexSet::MaxIndex | ( | void | ) | const |
Get maximum index used in this set (0 for emptyset).
bool faudes::IndexSet::Valid | ( | Idx | index | ) | const |
Test whether index is not 0.
index | Index to test |
Idx faudes::IndexSet::Insert | ( | void | ) |
Insert new index to set.
Reimplemented in faudes::TaIndexSet< Attr >, faudes::TaIndexSet< faudes::HioEventFlags >, faudes::TaIndexSet< faudes::SimConditionAttribute >, faudes::TaIndexSet< faudes::AttributeTimedState >, faudes::TaIndexSet< faudes::SimEventAttribute >, faudes::TaIndexSet< faudes::HioStateFlags >, faudes::TaIndexSet< StateAttr >, faudes::TaIndexSet< EventAttr >, and faudes::TaIndexSet< faudes::AttributeCFlags >.
bool faudes::IndexSet::Insert | ( | Idx | idx | ) |
Insert specified index.
idx | Index to insert |
Reimplemented in faudes::TaIndexSet< Attr >, faudes::NameSet, faudes::TaNameSet< Attr >, faudes::TaIndexSet< faudes::HioEventFlags >, faudes::TaIndexSet< faudes::SimConditionAttribute >, faudes::TaIndexSet< faudes::AttributeTimedState >, faudes::TaIndexSet< faudes::SimEventAttribute >, faudes::TaIndexSet< faudes::HioStateFlags >, faudes::TaIndexSet< StateAttr >, faudes::TaIndexSet< EventAttr >, faudes::TaIndexSet< faudes::AttributeCFlags >, faudes::TaNameSet< faudes::HioEventFlags >, faudes::TaNameSet< faudes::SimConditionAttribute >, faudes::TaNameSet< faudes::SimEventAttribute >, faudes::TaNameSet< EventAttr >, and faudes::TaNameSet< faudes::AttributeCFlags >.
Idx faudes::IndexSet::Signature | ( | void | ) | const |
Compute an Idx type signature for a Set.
The value is computed by summing up the product of every index with an integer starting at 1 (for the first index) and ending at Size() (for the last index).
std::string faudes::IndexSet::Str | ( | Idx | index | ) | const [inline] |
Return pretty printable index.
index | Index to print |
Reimplemented in faudes::NameSet, 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::IndexSet::DoWrite | ( | TokenWriter & | tw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Write to TokenWriter, see Type::Write for public wrappers.
Appends the IndexSet to TokenWriter. This will write a section with label as specified that holds integer tokens to represent the IndexSet. For non-default attribute values, the respective index is followed by the attribute value. The latter may consist of sections (or tokens different from integer or string) to allow for transparent reading; see AttributeVoid and AttributeFlags. Example for a set with name "MySet" consisting of indices 17, 25, 40, where index 25 has a nontrivial attribute attached:
<Myset>
17
25 <AValue> "Some Value" </AValue>
40
</MySet>
tw | Reference to TokenWriter | |
rLabel | Label of section to write, defaults to name of set or "IndexSet" | |
pContext | Write context to provide contextual information |
Exception |
|
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::NameSet.
void faudes::IndexSet::DoRead | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Read from TokenReader, see Type::Read for public wrappers.
This method invokes TokenReader::SeekBegin() to seek the specified section, reads subsequent integer tokens as indexes, calls matching TokenReader::SeekEnd(). When used by a derived class with attributes, attributes are read, too. If no section is specified, the section "IndexSet" is read.
rTr | Reference to tokenreader | |
rLabel | Section to read, defaults to "IndexSet" | |
pContext | Read context to provide contextual information |
Exception |
|
Reimplemented from faudes::TBaseSet< T, Cmp >.
Reimplemented in faudes::NameSet.
friend class TaIndexSet [friend] |
We implement "protected privacy for template classes" by friendship.
This is used for the pragmatic implemention conversion constructors.
libFAUDES 2.13a c++ source docu by doxygen 1.5.6