Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Data Structures | Public Member Functions
NCollection_SList< TheItemType > Class Template Reference

#include <NCollection_SList.hxx>

Inheritance diagram for NCollection_SList< TheItemType >:
Inheritance graph
[legend]

Data Structures

class  SListNode
 The node of SList. More...
 

Public Member Functions

 NCollection_SList (const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Empty constructor. More...
 
 NCollection_SList (const TheItemType &theItem, const NCollection_SList &theTail)
 Constructor. More...
 
 NCollection_SList (const NCollection_SList &theOther)
 Copy constructor. More...
 
void Clear (void)
 Clear the items out. More...
 
NCollection_SListoperator= (const NCollection_SList &theOther)
 Make this list identical to theOther. More...
 
virtual void Assign (const NCollection_BaseCollection< TheItemType > &theOther)
 Replace this list by the items of theOther collection. More...
 
Standard_Boolean IsEmpty (void) const
 IsEmpty query. More...
 
virtual const TheItemType & Value (void) const
 Value - constant access. More...
 
virtual TheItemType & ChangeValue (void) const
 ChangeValue - variable access. More...
 
void SetValue (const TheItemType &theItem)
 SetValue. More...
 
const NCollection_SListTail (void) const
 Tail. More...
 
NCollection_SListChangeTail (void)
 ChangeTail. More...
 
void SetTail (NCollection_SList &theList)
 SetTail. More...
 
void Construct (const TheItemType &theItem)
 Construct. More...
 
NCollection_SList Constructed (const TheItemType &theItem) const
 Constructed. More...
 
void ToTail (void)
 ToTail. More...
 
void Initialize (const NCollection_SList &theOther)
 Initialize (~Assign) More...
 
void Init (const NCollection_SList &theOther)
 Init (virtual method of base iterator) More...
 
virtual Standard_Boolean More (void) const
 More (~!IsEmpty) More...
 
virtual void Next (void)
 Next (~ToTail) More...
 
virtual Standard_Integer Size (void) const
 Size - Number of items. More...
 
 ~NCollection_SList (void)
 Destructor - clears the SList. More...
 
- Public Member Functions inherited from NCollection_BaseCollection< TheItemType >
 NCollection_BaseCollection (const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Common for all collections constructor takes care of theAllocator. More...
 
virtual ~NCollection_BaseCollection (void)
 Destructor - must be implemented to release the memory. More...
 
const Handle
< NCollection_BaseAllocator > & 
Allocator () const
 Returns attached allocator. More...
 

Additional Inherited Members

- Protected Member Functions inherited from NCollection_BaseCollection< TheItemType >
const Handle
< NCollection_BaseAllocator > & 
IterAllocator (void) const
 
void exchangeAllocators (NCollection_BaseCollection &theOther)
 Exchange allocators of two collections. More...
 
- Protected Member Functions inherited from NCollection_BaseCollection< TheItemType >::Iterator
 Iterator (void)
 Empty constructor. More...
 
virtual ~Iterator (void)
 Virtual destructor is necessary for classes with virtual methods. More...
 
const Iteratoroperator= (const Iterator &)
 operator= is prohibited More...
 
 Iterator (const Iterator &)
 Copy constructor **. More...
 
- Protected Attributes inherited from NCollection_BaseCollection< TheItemType >
Handle< NCollection_BaseAllocatormyAllocator
 

Detailed Description

template<class TheItemType>
class NCollection_SList< TheItemType >

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.

Constructor & Destructor Documentation

template<class TheItemType >
NCollection_SList< TheItemType >::NCollection_SList ( const Handle< NCollection_BaseAllocator > &  theAllocator = 0L)
inline

Empty constructor.

template<class TheItemType >
NCollection_SList< TheItemType >::NCollection_SList ( const TheItemType &  theItem,
const NCollection_SList< TheItemType > &  theTail 
)
inline

Constructor.

template<class TheItemType >
NCollection_SList< TheItemType >::NCollection_SList ( const NCollection_SList< TheItemType > &  theOther)
inline

Copy constructor.

template<class TheItemType >
NCollection_SList< TheItemType >::~NCollection_SList ( void  )
inline

Destructor - clears the SList.

Member Function Documentation

template<class TheItemType >
virtual void NCollection_SList< TheItemType >::Assign ( const NCollection_BaseCollection< TheItemType > &  theOther)
inlinevirtual

Replace this list by the items of theOther collection.

Implements NCollection_BaseCollection< TheItemType >.

template<class TheItemType >
NCollection_SList& NCollection_SList< TheItemType >::ChangeTail ( void  )
inline

ChangeTail.

template<class TheItemType >
virtual TheItemType& NCollection_SList< TheItemType >::ChangeValue ( void  ) const
inlinevirtual

ChangeValue - variable access.

Implements NCollection_BaseCollection< TheItemType >::Iterator.

template<class TheItemType >
void NCollection_SList< TheItemType >::Clear ( void  )
inline

Clear the items out.

template<class TheItemType >
void NCollection_SList< TheItemType >::Construct ( const TheItemType &  theItem)
inline

Construct.

template<class TheItemType >
NCollection_SList NCollection_SList< TheItemType >::Constructed ( const TheItemType &  theItem) const
inline

Constructed.

template<class TheItemType >
void NCollection_SList< TheItemType >::Init ( const NCollection_SList< TheItemType > &  theOther)
inline

Init (virtual method of base iterator)

template<class TheItemType >
void NCollection_SList< TheItemType >::Initialize ( const NCollection_SList< TheItemType > &  theOther)
inline

Initialize (~Assign)

template<class TheItemType >
Standard_Boolean NCollection_SList< TheItemType >::IsEmpty ( void  ) const
inline

IsEmpty query.

template<class TheItemType >
virtual Standard_Boolean NCollection_SList< TheItemType >::More ( void  ) const
inlinevirtual
template<class TheItemType >
virtual void NCollection_SList< TheItemType >::Next ( void  )
inlinevirtual
template<class TheItemType >
NCollection_SList& NCollection_SList< TheItemType >::operator= ( const NCollection_SList< TheItemType > &  theOther)
inline

Make this list identical to theOther.

template<class TheItemType >
void NCollection_SList< TheItemType >::SetTail ( NCollection_SList< TheItemType > &  theList)
inline

SetTail.

template<class TheItemType >
void NCollection_SList< TheItemType >::SetValue ( const TheItemType &  theItem)
inline

SetValue.

template<class TheItemType >
virtual Standard_Integer NCollection_SList< TheItemType >::Size ( void  ) const
inlinevirtual

Size - Number of items.

Implements NCollection_BaseCollection< TheItemType >.

template<class TheItemType >
const NCollection_SList& NCollection_SList< TheItemType >::Tail ( void  ) const
inline

Tail.

template<class TheItemType >
void NCollection_SList< TheItemType >::ToTail ( void  )
inline

ToTail.

template<class TheItemType >
virtual const TheItemType& NCollection_SList< TheItemType >::Value ( void  ) const
inlinevirtual

Value - constant access.

Implements NCollection_BaseCollection< TheItemType >::Iterator.


The documentation for this class was generated from the following file: