Open CASCADE Technology 6.6.0
|
#include <NCollection_SList.hxx>
Data Structures | |
class | SListNode |
The node of SList. More... | |
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 | 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. |
Purpose: An SList is a LISP like list of Items. An SList is : . Empty. . Or it has a Value and a Tail which is an other SList.
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.
NCollection_SList< TheItemType >::NCollection_SList | ( | const Handle< NCollection_BaseAllocator > & | theAllocator = 0L | ) | [inline] |
NCollection_SList< TheItemType >::NCollection_SList | ( | const TheItemType & | theItem, |
const NCollection_SList< TheItemType > & | theTail | ||
) | [inline] |
NCollection_SList< TheItemType >::NCollection_SList | ( | const NCollection_SList< TheItemType > & | theOther | ) | [inline] |
NCollection_SList< TheItemType >::~NCollection_SList | ( | void | ) | [inline] |
virtual void NCollection_SList< TheItemType >::Assign | ( | const NCollection_BaseCollection< TheItemType > & | theOther | ) | [inline, virtual] |
Implements NCollection_BaseCollection< TheItemType >.
NCollection_SList& NCollection_SList< TheItemType >::ChangeTail | ( | void | ) | [inline] |
virtual TheItemType& NCollection_SList< TheItemType >::ChangeValue | ( | void | ) | const [inline, virtual] |
void NCollection_SList< TheItemType >::Clear | ( | void | ) | [inline] |
void NCollection_SList< TheItemType >::Construct | ( | const TheItemType & | theItem | ) | [inline] |
NCollection_SList NCollection_SList< TheItemType >::Constructed | ( | const TheItemType & | theItem | ) | const [inline] |
void NCollection_SList< TheItemType >::Init | ( | const NCollection_SList< TheItemType > & | theOther | ) | [inline] |
void NCollection_SList< TheItemType >::Initialize | ( | const NCollection_SList< TheItemType > & | theOther | ) | [inline] |
Standard_Boolean NCollection_SList< TheItemType >::IsEmpty | ( | void | ) | const [inline] |
virtual Standard_Boolean NCollection_SList< TheItemType >::More | ( | void | ) | const [inline, virtual] |
virtual void NCollection_SList< TheItemType >::Next | ( | void | ) | [inline, virtual] |
NCollection_SList& NCollection_SList< TheItemType >::operator= | ( | const NCollection_SList< TheItemType > & | theOther | ) | [inline] |
void NCollection_SList< TheItemType >::SetTail | ( | NCollection_SList< TheItemType > & | theList | ) | [inline] |
void NCollection_SList< TheItemType >::SetValue | ( | const TheItemType & | theItem | ) | [inline] |
virtual Standard_Integer NCollection_SList< TheItemType >::Size | ( | void | ) | const [inline, virtual] |
Implements NCollection_BaseCollection< TheItemType >.
const NCollection_SList& NCollection_SList< TheItemType >::Tail | ( | void | ) | const [inline] |
void NCollection_SList< TheItemType >::ToTail | ( | void | ) | [inline] |
virtual const TheItemType& NCollection_SList< TheItemType >::Value | ( | void | ) | const [inline, virtual] |