| |
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>
Definition at line 290 of file indexset.h.
Public Types | |
typedef IndexSet::Iterator | Iterator |
Iterators on indexset. | |
Public Member Functions | |
virtual TaIndexSet * | New (void) const |
Faudes Type interface. | |
virtual TaIndexSet * | Copy (void) const |
Faudes Type interface. | |
virtual const TaIndexSet * | Cast (const Type *pOther) const |
Faudes Type interface. | |
virtual TaIndexSet & | Assign (const Type &rSrc) |
Assign configuration data from other object. | |
virtual bool | Equal (const Type &rOther) const |
Test equality of configuration data. | |
virtual TaIndexSet & | operator= (const TaIndexSet &rSrc) |
virtual bool | operator== (const TaIndexSet &rOther) const |
virtual bool | operator!= (const TaIndexSet &rOther) const |
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="") | |
Construct from file. | |
virtual | ~TaIndexSet (void) |
Virtual destructor. | |
virtual TaIndexSet & | Assign (const IndexSet &rSrc) |
Relaxed assignment method. | |
virtual TaIndexSet & | operator= (const IndexSet &rSrc) |
Relaxed assignment operator. | |
virtual void | Attributes (const IndexSet &rOtherSet) |
Set attributes. | |
virtual void | Attributes (const TaIndexSet &rOtherSet) |
Set attributes. | |
bool | Erase (const Idx &rIndex) |
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 (const Idx &rIndex) |
Insert element. | |
bool | Insert (const Idx &rIndex, const Attr &attr) |
Insert element with attribute. | |
virtual void | InsertSet (const IndexSet &rOtherSet) |
Inserts elements of rOtherSet. | |
virtual void | InsertSet (const TaIndexSet &rOtherSet) |
Inserts elements of rOtherSet. | |
virtual void | Clear (void) |
Clear all set. | |
Protected Member Functions | |
virtual TaIndexSet & | DoAssign (const TaIndexSet &rSource) |
Assign my members. | |
Friends | |
class | IndexSet |
We implement "protected privacy for template classes" by friendship. |
typedef IndexSet::Iterator faudes::TaIndexSet< Attr >::Iterator |
Iterators on indexset.
Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.
Definition at line 380 of file indexset.h.
faudes::TaIndexSet< Attr >::TaIndexSet | ( | void | ) | [inline] |
faudes::TaIndexSet< Attr >::TaIndexSet | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline] |
faudes::TaIndexSet< Attr >::TaIndexSet | ( | const IndexSet & | rOtherSet | ) | [inline] |
Copy-constructor (from IndexSet, sets attributes to default).
Definition at line 557 of file indexset.h.
faudes::TaIndexSet< Attr >::TaIndexSet | ( | const std::string & | rFilename, | |
const std::string & | rLabel = "" | |||
) | [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 |
|
Definition at line 570 of file indexset.h.
virtual faudes::TaIndexSet< Attr >::~TaIndexSet | ( | void | ) | [inline, virtual] |
TaIndexSet< Attr > * faudes::TaIndexSet< Attr >::New | ( | void | ) | const [inline, virtual] |
Faudes Type interface.
Construct object of same type on heap.
Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.
Definition at line 528 of file indexset.h.
TaIndexSet< Attr > * faudes::TaIndexSet< Attr >::Copy | ( | void | ) | const [inline, virtual] |
Faudes Type interface.
Construct copy on heap.
Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.
Definition at line 528 of file indexset.h.
const TaIndexSet< Attr > * faudes::TaIndexSet< Attr >::Cast | ( | const Type * | pType | ) | const [inline, virtual] |
Faudes Type interface.
Cast object to my type.
Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.
Definition at line 528 of file indexset.h.
TaIndexSet< Attr > & faudes::TaIndexSet< Attr >::Assign | ( | const Type & | rSrc | ) | [inline, virtual] |
Assign configuration data from other object.
Derived classes should reimplement this method to first try to cast the source to the respective class. If successful, the protected function DoAssign is invoked to perform the actual assignment. If the cast fails, the Assign method of the parent class is called. Thus, faudes objects are up- and downcatsted for assignment, maintaining as much of the source data as digestable by the destination object. On the downside, there is no sensible typechecking at compile-time.
Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
rSrc | Source to copy from |
Reimplemented from faudes::IndexSet.
Definition at line 528 of file indexset.h.
bool faudes::TaIndexSet< Attr >::Equal | ( | const Type & | rOther | ) | const [inline, virtual] |
Test equality of configuration data.
Derived classes should reimplement this method to return true if both actual types and configuration data match. The object name is not consired in the test.
This method calls the virtual method DoEqual(). Re-implementation can be done via the convenience macros FAUDES_TYPE_DECLARATION and FAUDES_TYPE_IMPLEMENTATION.
rOther | Other objevt to compare with. |
Reimplemented from faudes::IndexSet.
Definition at line 528 of file indexset.h.
TaIndexSet< Attr > & faudes::TaIndexSet< Attr >::operator= | ( | const TaIndexSet< Attr > & | rSrc | ) | [inline, virtual] |
Definition at line 528 of file indexset.h.
bool faudes::TaIndexSet< Attr >::operator== | ( | const TaIndexSet< Attr > & | rOther | ) | const [inline, virtual] |
Definition at line 528 of file indexset.h.
bool faudes::TaIndexSet< Attr >::operator!= | ( | const TaIndexSet< Attr > & | rOther | ) | const [inline, virtual] |
Definition at line 528 of file indexset.h.
TaIndexSet< Attr > & faudes::TaIndexSet< Attr >::Assign | ( | const IndexSet & | rSrc | ) | [inline, virtual] |
Relaxed assignment method.
Maintain provided they can be casted..
rSrc | Source from which to assign |
Definition at line 592 of file indexset.h.
TaIndexSet< Attr > & faudes::TaIndexSet< Attr >::operator= | ( | const IndexSet & | rSrc | ) | [inline, virtual] |
Relaxed assignment operator.
Maintain attributes provided they can be casted.
rSrc | Source from which to assign |
Reimplemented from faudes::IndexSet.
Definition at line 604 of file indexset.h.
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 |
|
Definition at line 618 of file indexset.h.
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 |
Definition at line 611 of file indexset.h.
bool faudes::TaIndexSet< Attr >::Erase | ( | const Idx & | rIndex | ) | [inline] |
Erase Element (incl its attribute).
rIndex | Index to specify element |
Definition at line 683 of file indexset.h.
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::TaBaseSet< T, Attr, Cmp >.
Definition at line 689 of file indexset.h.
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 |
Definition at line 696 of file indexset.h.
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 |
Definition at line 703 of file indexset.h.
Idx faudes::TaIndexSet< Attr >::Insert | ( | void | ) | [inline] |
Insert new index to set using default attribute.
Reimplemented from faudes::IndexSet.
Definition at line 633 of file indexset.h.
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 |
Definition at line 650 of file indexset.h.
bool faudes::TaIndexSet< Attr >::Insert | ( | const Idx & | rIndex | ) | [inline] |
Insert element.
If the element exists, the attribute is maintained. If the element does not exist, it is inserted with default attribute.
rIndex | Index to specify element |
Reimplemented from faudes::IndexSet.
Definition at line 642 of file indexset.h.
bool faudes::TaIndexSet< Attr >::Insert | ( | const Idx & | rIndex, | |
const Attr & | attr | |||
) | [inline] |
Insert element with attribute.
rIndex | Index to specify element | |
attr | Specify attribute of (new) element |
Definition at line 661 of file indexset.h.
void faudes::TaIndexSet< Attr >::InsertSet | ( | const IndexSet & | rOtherSet | ) | [inline, virtual] |
Inserts elements of rOtherSet.
Attributes of this set are maintained, newly inserted elements have default attribute.
rOtherSet | Other IndexSet |
Definition at line 676 of file indexset.h.
void faudes::TaIndexSet< Attr >::InsertSet | ( | const TaIndexSet< Attr > & | rOtherSet | ) | [inline, virtual] |
Inserts elements of rOtherSet.
Attributes of this set are maintained, new elements are inserted with attribute.
rOtherSet | Other IndexSet |
Definition at line 669 of file indexset.h.
void faudes::TaIndexSet< Attr >::Clear | ( | void | ) | [inline, virtual] |
Clear all set.
Reimplemented from faudes::TaBaseSet< T, Attr, Cmp >.
Definition at line 626 of file indexset.h.
TaIndexSet< Attr > & faudes::TaIndexSet< Attr >::DoAssign | ( | const TaIndexSet< Attr > & | rSource | ) | [inline, protected, virtual] |
Assign my members.
This method maintains attributes.
rSource | Source to copy from |
Definition at line 582 of file indexset.h.
friend class IndexSet [friend] |
We implement "protected privacy for template classes" by friendship.
This is used for the pragmatic implemention conversion constructors.
Definition at line 298 of file indexset.h.
libFAUDES 2.14g --- 2009-12-3 --- c++ source docu by doxygen 1.5.6