| |
libFAUDES
Sections
Index
|
faudes::TaIndexSet< Attr > Class Template Reference |
mAttributeMap | STL map of type std::map<Idx,Attr> to hold attributes |
The format for token IO is demonstrated by the following example of 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>
Public Member Functions | |
TaIndexSet (void) | |
Constructor. | |
TaIndexSet (const TaIndexSet &rOtherSet) | |
Copy-constructor (from TaIndexSet, incl attributes). | |
TaIndexSet (const IndexSet &rOtherSet) | |
Copy-constructor (from IndexSet, sets attributes to default). | |
TaIndexSet (const std::string &rFilename, const std::string &rLabel="IndexSet") | |
Construct from file. | |
virtual TaIndexSet * | New (void) const |
Construct on heap with same type. | |
virtual | ~TaIndexSet (void) |
Virtual destructor. | |
virtual TaIndexSet & | operator= (const TaIndexSet &rSrc) |
Assignment operator (uses Copy). | |
virtual TaIndexSet & | operator= (const IndexSet &rSrc) |
Assignment operator (uses Copy). | |
virtual void | Copy (TaIndexSet< Attr > &rSet) const |
Copy to other index with same attribute type. | |
virtual void | Copy (IndexSet &rSet) const |
Copy to other index set. | |
virtual Idx | AttributesSize (void) const |
Get number of explicit (aka non-default) attributes. | |
virtual const Attr * | Attributep (void) const |
Attribute typeinfo. | |
virtual const AttributeVoid & | Attribute (void) const |
Attribute typeinfo. | |
virtual bool | AttributeTry (const Type &rAttr) const |
Attribute typeinfo. | |
virtual Attr * | Attributep (const Idx &idx) |
Get attribute reference by index. | |
virtual const Attr & | Attribute (const Idx &idx) const |
Get attribute by index. | |
virtual void | Attribute (const Idx &idx, const Attr &attr) |
Set attribute. | |
virtual void | Attribute (const Idx &idx, const Type &attr) |
Set attribute. | |
virtual void | AttributeTry (const Idx &idx, const Type &attr) |
Set attribute. | |
virtual void | Attributes (const IndexSet &rOtherSet) |
Set attributes. | |
virtual void | Attributes (const TaIndexSet &rOtherSet) |
Set attributes. | |
virtual void | ClrAttribute (const Idx &idx) |
Clear attribute to default value. | |
virtual void | ClearAttributes (void) |
Clear all attributes to default value. | |
bool | Erase (Idx idx) |
Erase Element (incl its attribute). | |
Iterator | Erase (const Iterator &pos) |
Erase element by iterator (incl attribute). | |
void | EraseSet (const IndexSet &rOtherSet) |
Erase elements given by other set. | |
void | RestrictSet (const IndexSet &rOtherSet) |
Restrict to specified subset. | |
Idx | Insert (void) |
Insert new index to set using default attribute. | |
Idx | Insert (const Attr &rAttr) |
Insert new index with attribute. | |
bool | Insert (Idx idx) |
Insert element. | |
bool | Insert (Idx idx, const Attr &attr) |
Insert element with attribute. | |
void | InsertSet (const IndexSet &rOtherSet) |
Inserts elements of rOtherSet. | |
void | InsertSet (const TaIndexSet &rOtherSet) |
Inserts elements of rOtherSet. | |
virtual void | Clear (void) |
Clear all set. | |
void | SetUnion (const TaIndexSet &rOtherSet) |
Set union. | |
void | SetUnion (const IndexSet &rOtherSet) |
Set union. | |
void | SetIntersection (const TaIndexSet &rOtherSet) |
Set intersection. | |
void | SetIntersection (const IndexSet &rOtherSet) |
Set intersection. | |
Protected Attributes | |
std::map< Idx, Attr > | mAttributeMap |
Stored attributes. | |
Static Protected Attributes | |
static Attr | mDefAttribute |
default attribute | |
Friends | |
class | IndexSet |
We implement "protected privacy for template classes" by friendship. |
faudes::TaIndexSet< Attr >::TaIndexSet | ( | void | ) | [inline] |
Constructor.
faudes::TaIndexSet< Attr >::TaIndexSet | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline] |
Copy-constructor (from TaIndexSet, incl attributes).
faudes::TaIndexSet< Attr >::TaIndexSet | ( | const IndexSet & | rOtherSet | ) | [inline] |
Copy-constructor (from IndexSet, sets attributes to default).
faudes::TaIndexSet< Attr >::TaIndexSet | ( | const std::string & | rFilename, | |
const std::string & | rLabel = "IndexSet" | |||
) | [inline] |
Construct from file.
This constructor uses the Read(TokenReader&, const std::string&) function to read.
rFilename | Name of file | |
rLabel | Section for the set in file |
Exception |
|
virtual faudes::TaIndexSet< Attr >::~TaIndexSet | ( | void | ) | [inline, virtual] |
Virtual destructor.
TaIndexSet< Attr > * faudes::TaIndexSet< Attr >::New | ( | void | ) | const [inline, virtual] |
Construct on heap with same type.
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 >.
virtual TaIndexSet& faudes::TaIndexSet< Attr >::operator= | ( | const TaIndexSet< Attr > & | rSrc | ) | [inline, virtual] |
Assignment operator (uses Copy).
rSrc | Source from which to assign |
virtual TaIndexSet& faudes::TaIndexSet< Attr >::operator= | ( | const IndexSet & | rSrc | ) | [inline, virtual] |
Assignment operator (uses Copy).
rSrc | Source from which to assign |
Reimplemented from faudes::IndexSet.
void faudes::TaIndexSet< Attr >::Copy | ( | TaIndexSet< Attr > & | rSet | ) | const [inline, virtual] |
Copy to other index with same attribute type.
rSet |
void faudes::TaIndexSet< Attr >::Copy | ( | IndexSet & | rSet | ) | const [inline, virtual] |
Copy to other index set.
This function maintains attributes if types can be casted.
rSet |
Reimplemented from faudes::IndexSet.
Idx faudes::TaIndexSet< Attr >::AttributesSize | ( | void | ) | const [inline, virtual] |
Get number of explicit (aka non-default) attributes.
Reimplemented from faudes::TBaseSet< T, Cmp >.
virtual const Attr* faudes::TaIndexSet< Attr >::Attributep | ( | void | ) | const [inline, virtual] |
Attribute typeinfo.
Reimplemented from faudes::TBaseSet< T, Cmp >.
virtual const AttributeVoid& faudes::TaIndexSet< Attr >::Attribute | ( | void | ) | const [inline, virtual] |
Attribute typeinfo.
Reimplemented from faudes::TBaseSet< T, Cmp >.
virtual bool faudes::TaIndexSet< Attr >::AttributeTry | ( | const Type & | rAttr | ) | const [inline, virtual] |
Attribute typeinfo.
This set accepts all attributes that we can cast to our attribute type.
rAttr | Attribute type to test. |
Reimplemented from faudes::TBaseSet< T, Cmp >.
Attr * faudes::TaIndexSet< Attr >::Attributep | ( | const Idx & | idx | ) | [inline, virtual] |
Get attribute reference by index.
Note that in order to produce a non-const reference this method will insert an explicit default attribute if necessary. If a const reference is sufficient, you should use Attribute(Idx) const instead.
idx | Index to specify element |
Exception |
|
const Attr & faudes::TaIndexSet< Attr >::Attribute | ( | const Idx & | idx | ) | const [inline, virtual] |
Get attribute by index.
This function returns a const reference to the attribute of the specified index.
idx | Index to specify element |
Exception |
|
void faudes::TaIndexSet< Attr >::Attribute | ( | const Idx & | idx, | |
const Attr & | attr | |||
) | [inline, virtual] |
Set attribute.
Sets the attribute of the sepcified element to the given value.
idx | Index to specify element | |
attr | Attribute value. |
Exception |
|
void faudes::TaIndexSet< Attr >::Attribute | ( | const Idx & | idx, | |
const Type & | attr | |||
) | [inline, virtual] |
Set attribute.
Provided that the attribute can be casted to the appropriate type, this method sets the attribute of the sepcified element to the given value.
idx | Index to specify element | |
attr | Attribute value. |
Exception |
|
void faudes::TaIndexSet< Attr >::AttributeTry | ( | const Idx & | idx, | |
const Type & | attr | |||
) | [inline, virtual] |
Set attribute.
Provided that the attribute can be casted to the appropriate type, this method sets the attribute of the sepcified element to the given value.
idx | Index to specify element | |
attr | Attribute value. |
Exception |
|
void faudes::TaIndexSet< Attr >::Attributes | ( | const IndexSet & | rOtherSet | ) | [inline, virtual] |
Set attributes.
Provided that rOtherSet has attributes that can be casted to the appropriate type, attributes are copied per element from rOtherSet. Elements of this set which are not in rOtherSet maintain their attribute.
rOtherSet | Other IndexSet |
Exception |
|
void faudes::TaIndexSet< Attr >::Attributes | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline, virtual] |
Set attributes.
Attributes are copied per element from rOtherSet. Elements of this set which are not in rOtherSet maintain their attribute.
rOtherSet | Other IndexSet |
void faudes::TaIndexSet< Attr >::ClrAttribute | ( | const Idx & | idx | ) | [inline, virtual] |
Clear attribute to default value.
idx | index to specify element |
void faudes::TaIndexSet< Attr >::ClearAttributes | ( | void | ) | [inline, virtual] |
bool faudes::TaIndexSet< Attr >::Erase | ( | Idx | idx | ) | [inline] |
Erase Element (incl its attribute).
idx | Index to specify element |
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 >.
TaIndexSet< Attr >::Iterator faudes::TaIndexSet< Attr >::Erase | ( | const Iterator & | pos | ) | [inline, virtual] |
Erase element by iterator (incl attribute).
pos | Iterator to specify element |
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::TaIndexSet< Attr >::EraseSet | ( | const IndexSet & | rOtherSet | ) | [inline] |
Erase elements given by other set.
This function ignores the attributes of the other set and maintains the attributes of the remaining elements in this set.
rOtherSet | Elements to erase |
void faudes::TaIndexSet< Attr >::RestrictSet | ( | const IndexSet & | rOtherSet | ) | [inline] |
Restrict to specified subset.
Erases any elements no in the specified set. This function ignores the attributes of the other set and maintains the attributes of the remaining elements in this set.
rOtherSet | Elements to erase |
Idx faudes::TaIndexSet< Attr >::Insert | ( | void | ) | [inline] |
Insert new index to set using default attribute.
Reimplemented from faudes::IndexSet.
Idx faudes::TaIndexSet< Attr >::Insert | ( | const Attr & | rAttr | ) | [inline] |
Insert new index with attribute.
If the index allready exists, the attribute is overwritten by rAttr.
rAttr | Specify attribute of new element |
bool faudes::TaIndexSet< Attr >::Insert | ( | Idx | idx | ) | [inline] |
Insert element.
If the element exists, the attribute is maintained. If the element does not exist, it is inserted with default attribute.
idx | Index to specify element |
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 >.
bool faudes::TaIndexSet< Attr >::Insert | ( | Idx | idx, | |
const Attr & | attr | |||
) | [inline] |
Insert element with attribute.
idx | Index to specify element | |
attr | Specify attribute of (new) element |
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::TaIndexSet< Attr >::InsertSet | ( | const IndexSet & | rOtherSet | ) | [inline] |
Inserts elements of rOtherSet.
Attributes of this set are maintained, newly inserted elements have default attribute.
rOtherSet | Other IndexSet |
void faudes::TaIndexSet< Attr >::InsertSet | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline] |
Inserts elements of rOtherSet.
Attributes of this set are maintained, new elements are inserted with attribute.
rOtherSet | Other IndexSet |
void faudes::TaIndexSet< Attr >::Clear | ( | void | ) | [inline, virtual] |
void faudes::TaIndexSet< Attr >::SetUnion | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline] |
Set union.
The union is wrt the set of indices, the result is accumulated in this set. Attributes are set to default. See also InsertSet(const TaIndexSet&).
rOtherSet | Other TaIndexSet |
void faudes::TaIndexSet< Attr >::SetUnion | ( | const IndexSet & | rOtherSet | ) | [inline] |
Set union.
The union is wrt the set of indices, the result is accumulated in this set. Attributes are set to default. See also InsertSet(const IndexSet&).
rOtherSet | Other IndexSet |
void faudes::TaIndexSet< Attr >::SetIntersection | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline] |
Set intersection.
The intersection is wrt set of indices, the result is stored in this set. Attributes are set to default.
rOtherSet | Other IndexSet |
void faudes::TaIndexSet< Attr >::SetIntersection | ( | const IndexSet & | rOtherSet | ) | [inline] |
Set intersection.
The intersection is wrt set of indices, the result is stored in this set. Attributes are set to default.
rOtherSet | Other IndexSet |
friend class IndexSet [friend] |
We implement "protected privacy for template classes" by friendship.
This is used for the pragmatic implemention conversion constructors.
std::map<Idx,Attr> faudes::TaIndexSet< Attr >::mAttributeMap [protected] |
Stored attributes.
libFAUDES 2.13a c++ source docu by doxygen 1.5.6