#include <NCollection_SList.hxx>
Inheritance diagram for NCollection_SList< TheItemType >:
Public Member Functions | |
NCollection_SList (const Handle(NCollection_BaseAllocator)&theAllocator=0L) | |
Empty constructor. | |
NCollection_SList (const TheItemType &theItem, const NCollection_SList &theTail) | |
Constructor. | |
NCollection_SList (const NCollection_SList &theOther) | |
Copy constructor. | |
void * | operator new (size_t theSize, const Handle(NCollection_BaseAllocator)&theAllocator) |
Operator new for creating 'iterator'. | |
void | Clear (void) |
Clear the items out. | |
NCollection_SList & | operator= (const NCollection_SList &theOther) |
Make this list identical to theOther. | |
virtual void | Assign (const NCollection_BaseCollection< TheItemType > &theOther) |
Replace this list by the items of theOther collection. | |
Standard_Boolean | IsEmpty (void) const |
IsEmpty query. | |
virtual const TheItemType & | Value (void) const |
Value - constant access. | |
virtual TheItemType & | ChangeValue (void) const |
ChangeValue - variable access. | |
void | SetValue (const TheItemType &theItem) |
SetValue. | |
const NCollection_SList & | Tail (void) const |
Tail. | |
NCollection_SList & | ChangeTail (void) |
ChangeTail. | |
void | SetTail (NCollection_SList &theList) |
SetTail. | |
void | Construct (const TheItemType &theItem) |
Construct. | |
NCollection_SList | Constructed (const TheItemType &theItem) const |
Constructed. | |
void | ToTail (void) |
ToTail. | |
void | Initialize (const NCollection_SList &theOther) |
Initialize (~Assign). | |
void | Init (const NCollection_SList &theOther) |
Init (virtual method of base iterator). | |
virtual Standard_Boolean | More (void) const |
More (~!IsEmpty). | |
virtual void | Next (void) |
Next (~ToTail). | |
virtual Standard_Integer | Size (void) const |
Size - Number of items. | |
~NCollection_SList (void) | |
Destructor - clears the SList. | |
Private Member Functions | |
virtual TYPENAME NCollection_BaseCollection< TheItemType >::Iterator & | CreateIterator (void) const |
Creates Iterator for use on BaseCollection. | |
Private Attributes | |
SListNode * | myNode |
Data Structures | |
class | SListNode |
The node of SList. More... |
The Tail of an empty list is an empty list. SList are shared. It means that they can be modified through other lists. SList may be used as Iterators. They have Next, More, and value methods. To iterate on the content of the list S just do.
SList Iterator; for (Iterator = S; Iterator.More(); Iterator.Next()) X = Iterator.Value();
Memory usage is automatically managed for SLists (using reference counts).
Example: If S1 and S2 are SLists : if S1.Value() is X.
And the following is done : S2 = S1; S2.SetValue(Y);
S1.Value() becomes also Y. So SList must be used with care. Mainly the SetValue() method is dangerous.
|
|
|
|
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >::Iterator. |
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >. |
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >::Iterator. |
|
Implements NCollection_BaseCollection< TheItemType >::Iterator. |
|
|
|
|
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >. |
|
|
|
|
|
Implements NCollection_BaseCollection< TheItemType >::Iterator. |
|
|