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

#include <NCollection_Stack.hxx>

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

Public Types

typedef NCollection_TListNode
< TheItemType > 
StackNode
 
typedef
NCollection_TListIterator
< TheItemType > 
Iterator
 

Public Member Functions

 NCollection_Stack (const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Constructor. More...
 
 NCollection_Stack (const NCollection_Stack &theOther)
 Copy constructor. More...
 
virtual Standard_Integer Size (void) const
 Size - Number of items. More...
 
Standard_Integer Depth (void) const
 Depth - Number of items. More...
 
virtual void Assign (const NCollection_BaseCollection< TheItemType > &theOther)
 Replace this list by the items of theOther collection. More...
 
NCollection_Stackoperator= (const NCollection_Stack &theOther)
 Replace this list by the items of theOther Stack. More...
 
void Clear (void)
 Clear this stack. More...
 
const TheItemType & Top (void) const
 Top item - constant. More...
 
TheItemType & ChangeTop (void)
 Top item - variable. More...
 
void Push (const TheItemType &theItem)
 Push one item. More...
 
void Pop (void)
 Pop top item. More...
 
 ~NCollection_Stack (void)
 Destructor - clears the List. 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...
 
- Public Member Functions inherited from NCollection_BaseList
Standard_Integer Extent (void) const
 
Standard_Boolean IsEmpty (void) const
 

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_BaseList
 NCollection_BaseList (void)
 
void PClear (NCollection_DelListNode fDel, Handle< NCollection_BaseAllocator > &theAllocator)
 
const NCollection_ListNodePFirst (void) const
 
const NCollection_ListNodePLast (void) const
 
void PAppend (NCollection_ListNode *theNode)
 
void PAppend (NCollection_ListNode *theNode, Iterator &theIt)
 
void PAppend (NCollection_BaseList &theOther)
 
void PPrepend (NCollection_ListNode *theNode)
 
void PPrepend (NCollection_BaseList &theOther)
 
void PRemoveFirst (NCollection_DelListNode fDel, Handle< NCollection_BaseAllocator > &theAllocator)
 
void PRemove (Iterator &theIter, NCollection_DelListNode fDel, Handle< NCollection_BaseAllocator > &theAllocator)
 
void PInsertBefore (NCollection_ListNode *theNode, Iterator &theIter)
 
void PInsertBefore (NCollection_BaseList &theOther, Iterator &theIter)
 
void PInsertAfter (NCollection_ListNode *theNode, Iterator &theIter)
 
void PInsertAfter (NCollection_BaseList &theOther, Iterator &theIter)
 
void PReverse ()
 
- Protected Attributes inherited from NCollection_BaseCollection< TheItemType >
Handle< NCollection_BaseAllocatormyAllocator
 
- Protected Attributes inherited from NCollection_BaseList
NCollection_ListNodemyFirst
 
NCollection_ListNodemyLast
 
Standard_Integer myLength
 

Detailed Description

template<class TheItemType>
class NCollection_Stack< TheItemType >

Purpose: A stack is a structure where item can be added and removed from the top. Like a stack of plates in a kitchen. The last entered item will be be the first removed. This is called a LIFO (last In First Out). Inherits BaseList, adding the data item to each node.

Member Typedef Documentation

template<class TheItemType >
typedef NCollection_TListIterator<TheItemType> NCollection_Stack< TheItemType >::Iterator
template<class TheItemType >
typedef NCollection_TListNode<TheItemType> NCollection_Stack< TheItemType >::StackNode

Constructor & Destructor Documentation

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

Constructor.

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

Copy constructor.

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

Destructor - clears the List.

Member Function Documentation

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

Replace this list by the items of theOther collection.

Implements NCollection_BaseCollection< TheItemType >.

template<class TheItemType >
TheItemType& NCollection_Stack< TheItemType >::ChangeTop ( void  )
inline

Top item - variable.

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

Clear this stack.

template<class TheItemType >
Standard_Integer NCollection_Stack< TheItemType >::Depth ( void  ) const
inline

Depth - Number of items.

template<class TheItemType >
NCollection_Stack& NCollection_Stack< TheItemType >::operator= ( const NCollection_Stack< TheItemType > &  theOther)
inline

Replace this list by the items of theOther Stack.

template<class TheItemType >
void NCollection_Stack< TheItemType >::Pop ( void  )
inline

Pop top item.

template<class TheItemType >
void NCollection_Stack< TheItemType >::Push ( const TheItemType &  theItem)
inline

Push one item.

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

Size - Number of items.

Implements NCollection_BaseCollection< TheItemType >.

template<class TheItemType >
const TheItemType& NCollection_Stack< TheItemType >::Top ( void  ) const
inline

Top item - constant.


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