Open CASCADE Technology  6.9.1
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
NCollection_Sequence< TheItemType > Class Template Reference

#include <NCollection_Sequence.hxx>

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

Data Structures

class  Iterator
 Implementation of the Iterator interface. More...
 
class  Node
 Class defining sequence node - for internal use by Sequence. More...
 

Public Types

typedef TheItemType value_type
 STL-compliant typedef for value type. More...
 
typedef NCollection_StlIterator< std::bidirectional_iterator_tag, Iterator, TheItemType, false > iterator
 Shorthand for a regular iterator type. More...
 
typedef NCollection_StlIterator< std::bidirectional_iterator_tag, Iterator, TheItemType, true > const_iterator
 Shorthand for a constant iterator type. More...
 

Public Member Functions

iterator begin () const
 Returns an iterator pointing to the first element in the sequence. More...
 
iterator end () const
 Returns an iterator referring to the past-the-end element in the sequence. More...
 
const_iterator cbegin () const
 Returns a const iterator pointing to the first element in the sequence. More...
 
const_iterator cend () const
 Returns a const iterator referring to the past-the-end element in the sequence. More...
 
 NCollection_Sequence (const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Constructor. More...
 
 NCollection_Sequence (const NCollection_Sequence &theOther)
 Copy constructor. More...
 
Standard_Integer Size (void) const
 Number of items. More...
 
Standard_Integer Length (void) const
 Number of items. More...
 
Standard_Integer Lower () const
 Method for consistency with other collections. More...
 
Standard_Integer Upper () const
 Method for consistency with other collections. More...
 
Standard_Boolean IsEmpty (void) const
 Empty query. More...
 
void Reverse (void)
 Reverse sequence. More...
 
void Exchange (const Standard_Integer I, const Standard_Integer J)
 Exchange two members. More...
 
void Clear (const Handle< NCollection_BaseAllocator > &theAllocator=0L)
 Clear the items out, take a new allocator if non null. More...
 
NCollection_SequenceAssign (const NCollection_Sequence &theOther)
 Replace this sequence by the items of theOther. This method does not change the internal allocator. More...
 
NCollection_Sequenceoperator= (const NCollection_Sequence &theOther)
 Replacement operator. More...
 
void Remove (Iterator &thePosition)
 Remove one item. More...
 
void Remove (const Standard_Integer theIndex)
 Remove one item. More...
 
void Remove (const Standard_Integer theFromIndex, const Standard_Integer theToIndex)
 Remove range of items. More...
 
void Append (const TheItemType &theItem)
 Append one item. More...
 
void Append (NCollection_Sequence &theSeq)
 Append another sequence (making it empty) More...
 
void Prepend (const TheItemType &theItem)
 Prepend one item. More...
 
void Prepend (NCollection_Sequence &theSeq)
 Prepend another sequence (making it empty) More...
 
void InsertBefore (const Standard_Integer theIndex, const TheItemType &theItem)
 InsertBefore theIndex theItem. More...
 
void InsertBefore (const Standard_Integer theIndex, NCollection_Sequence &theSeq)
 InsertBefore theIndex another sequence. More...
 
void InsertAfter (Iterator &thePosition, const TheItemType &theItem)
 InsertAfter the position of iterator. More...
 
void InsertAfter (const Standard_Integer theIndex, NCollection_Sequence &theSeq)
 InsertAfter theIndex theItem. More...
 
void InsertAfter (const Standard_Integer theIndex, const TheItemType &theItem)
 InsertAfter theIndex another sequence. More...
 
void Split (const Standard_Integer theIndex, NCollection_Sequence &theSeq)
 Split in two sequences. More...
 
const TheItemType & First () const
 First item access. More...
 
TheItemType & ChangeFirst ()
 First item access. More...
 
const TheItemType & Last () const
 Last item access. More...
 
TheItemType & ChangeLast ()
 Last item access. More...
 
const TheItemType & Value (const Standard_Integer theIndex) const
 Constant item access by theIndex. More...
 
const TheItemType & operator() (const Standard_Integer theIndex) const
 Constant operator() More...
 
TheItemType & ChangeValue (const Standard_Integer theIndex)
 Variable item access by theIndex. More...
 
TheItemType & operator() (const Standard_Integer theIndex)
 Variable operator() More...
 
void SetValue (const Standard_Integer theIndex, const TheItemType &theItem)
 Set item value by theIndex. More...
 
 ~NCollection_Sequence (void)
 
- Public Member Functions inherited from NCollection_BaseSequence
Standard_Boolean IsEmpty () const
 
Standard_Integer Length () const
 

Static Public Member Functions

static void delNode (NCollection_SeqNode *theNode, Handle< NCollection_BaseAllocator > &theAl)
 Static deleter to be passed to BaseSequence. More...
 

Additional Inherited Members

- Protected Member Functions inherited from NCollection_BaseSequence
 NCollection_BaseSequence (const Handle< NCollection_BaseAllocator > &theAllocator)
 
void ClearSeq (NCollection_DelSeqNode fDel)
 
void PAppend (NCollection_SeqNode *)
 
void PAppend (NCollection_BaseSequence &S)
 
void PPrepend (NCollection_SeqNode *)
 
void PPrepend (NCollection_BaseSequence &S)
 
void PInsertAfter (Iterator &thePosition, NCollection_SeqNode *)
 
void PInsertAfter (const Standard_Integer Index, NCollection_SeqNode *)
 
void PInsertAfter (const Standard_Integer Index, NCollection_BaseSequence &S)
 
void PSplit (const Standard_Integer Index, NCollection_BaseSequence &Sub)
 
void RemoveSeq (Iterator &thePosition, NCollection_DelSeqNode fDel)
 
void RemoveSeq (const Standard_Integer Index, NCollection_DelSeqNode fDel)
 
void RemoveSeq (const Standard_Integer From, const Standard_Integer To, NCollection_DelSeqNode fDel)
 
void PReverse ()
 
void PExchange (const Standard_Integer I, const Standard_Integer J)
 
NCollection_SeqNodeFind (const Standard_Integer) const
 
- Protected Attributes inherited from NCollection_BaseSequence
Handle< NCollection_BaseAllocatormyAllocator
 
NCollection_SeqNodemyFirstItem
 
NCollection_SeqNodemyLastItem
 
NCollection_SeqNodemyCurrentItem
 
Standard_Integer myCurrentIndex
 
Standard_Integer mySize
 

Detailed Description

template<class TheItemType>
class NCollection_Sequence< TheItemType >

Purpose: Definition of a sequence of elements indexed by an Integer in range of 1..n

Member Typedef Documentation

template<class TheItemType>
typedef NCollection_StlIterator<std::bidirectional_iterator_tag, Iterator, TheItemType, true> NCollection_Sequence< TheItemType >::const_iterator

Shorthand for a constant iterator type.

template<class TheItemType>
typedef NCollection_StlIterator<std::bidirectional_iterator_tag, Iterator, TheItemType, false> NCollection_Sequence< TheItemType >::iterator

Shorthand for a regular iterator type.

template<class TheItemType>
typedef TheItemType NCollection_Sequence< TheItemType >::value_type

STL-compliant typedef for value type.

Constructor & Destructor Documentation

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

Constructor.

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

Copy constructor.

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

Member Function Documentation

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Append ( const TheItemType &  theItem)
inline

Append one item.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Append ( NCollection_Sequence< TheItemType > &  theSeq)
inline

Append another sequence (making it empty)

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

Replace this sequence by the items of theOther. This method does not change the internal allocator.

template<class TheItemType>
iterator NCollection_Sequence< TheItemType >::begin ( ) const
inline

Returns an iterator pointing to the first element in the sequence.

template<class TheItemType>
const_iterator NCollection_Sequence< TheItemType >::cbegin ( ) const
inline

Returns a const iterator pointing to the first element in the sequence.

template<class TheItemType>
const_iterator NCollection_Sequence< TheItemType >::cend ( ) const
inline

Returns a const iterator referring to the past-the-end element in the sequence.

template<class TheItemType>
TheItemType& NCollection_Sequence< TheItemType >::ChangeFirst ( )
inline

First item access.

template<class TheItemType>
TheItemType& NCollection_Sequence< TheItemType >::ChangeLast ( )
inline

Last item access.

template<class TheItemType>
TheItemType& NCollection_Sequence< TheItemType >::ChangeValue ( const Standard_Integer  theIndex)
inline

Variable item access by theIndex.

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

Clear the items out, take a new allocator if non null.

template<class TheItemType>
static void NCollection_Sequence< TheItemType >::delNode ( NCollection_SeqNode theNode,
Handle< NCollection_BaseAllocator > &  theAl 
)
inlinestatic

Static deleter to be passed to BaseSequence.

template<class TheItemType>
iterator NCollection_Sequence< TheItemType >::end ( ) const
inline

Returns an iterator referring to the past-the-end element in the sequence.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Exchange ( const Standard_Integer  I,
const Standard_Integer  J 
)
inline

Exchange two members.

template<class TheItemType>
const TheItemType& NCollection_Sequence< TheItemType >::First ( ) const
inline

First item access.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::InsertAfter ( Iterator thePosition,
const TheItemType &  theItem 
)
inline

InsertAfter the position of iterator.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::InsertAfter ( const Standard_Integer  theIndex,
NCollection_Sequence< TheItemType > &  theSeq 
)
inline

InsertAfter theIndex theItem.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::InsertAfter ( const Standard_Integer  theIndex,
const TheItemType &  theItem 
)
inline

InsertAfter theIndex another sequence.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::InsertBefore ( const Standard_Integer  theIndex,
const TheItemType &  theItem 
)
inline

InsertBefore theIndex theItem.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::InsertBefore ( const Standard_Integer  theIndex,
NCollection_Sequence< TheItemType > &  theSeq 
)
inline

InsertBefore theIndex another sequence.

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

Empty query.

template<class TheItemType>
const TheItemType& NCollection_Sequence< TheItemType >::Last ( ) const
inline

Last item access.

template<class TheItemType>
Standard_Integer NCollection_Sequence< TheItemType >::Length ( void  ) const
inline

Number of items.

template<class TheItemType>
Standard_Integer NCollection_Sequence< TheItemType >::Lower ( void  ) const
inline

Method for consistency with other collections.

Returns
Lower bound (inclusive) for iteration.
template<class TheItemType>
const TheItemType& NCollection_Sequence< TheItemType >::operator() ( const Standard_Integer  theIndex) const
inline

Constant operator()

template<class TheItemType>
TheItemType& NCollection_Sequence< TheItemType >::operator() ( const Standard_Integer  theIndex)
inline

Variable operator()

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

Replacement operator.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Prepend ( const TheItemType &  theItem)
inline

Prepend one item.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Prepend ( NCollection_Sequence< TheItemType > &  theSeq)
inline

Prepend another sequence (making it empty)

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Remove ( Iterator thePosition)
inline

Remove one item.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Remove ( const Standard_Integer  theIndex)
inline

Remove one item.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Remove ( const Standard_Integer  theFromIndex,
const Standard_Integer  theToIndex 
)
inline

Remove range of items.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Reverse ( void  )
inline

Reverse sequence.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::SetValue ( const Standard_Integer  theIndex,
const TheItemType &  theItem 
)
inline

Set item value by theIndex.

template<class TheItemType>
Standard_Integer NCollection_Sequence< TheItemType >::Size ( void  ) const
inline

Number of items.

template<class TheItemType>
void NCollection_Sequence< TheItemType >::Split ( const Standard_Integer  theIndex,
NCollection_Sequence< TheItemType > &  theSeq 
)
inline

Split in two sequences.

template<class TheItemType>
Standard_Integer NCollection_Sequence< TheItemType >::Upper ( void  ) const
inline

Method for consistency with other collections.

Returns
Upper bound (inclusive) for iteration.
template<class TheItemType>
const TheItemType& NCollection_Sequence< TheItemType >::Value ( const Standard_Integer  theIndex) const
inline

Constant item access by theIndex.


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