Open CASCADE Technology  7.3.0
Public Member Functions | Protected Member Functions | Protected Attributes
TCollection_BaseSequence Class Reference

Definition of a base class for all instanciations of sequence. More...

#include <TCollection_BaseSequence.hxx>

Public Member Functions

Standard_Boolean IsEmpty () const
 returns True if the sequence <me> contains no elements. More...
 
Standard_Integer Length () const
 Returns the number of element(s) in the sequence. Returns zero if the sequence is empty. More...
 
void Reverse ()
 Reverses the order of items on <me>. Example: before me = (A B C) after me = (C B A) More...
 
void Exchange (const Standard_Integer I, const Standard_Integer J)
 Swaps elements which are located at positions and <J> in <me>. Raises an exception if I or J is out of bound. Example: before me = (A B C), I = 1, J = 3 after me = (C B A) More...
 

Protected Member Functions

 TCollection_BaseSequence ()
 Creation of an empty sequence. More...
 
void Clear (const Standard_Address DelNode)
 
void PAppend (const Standard_Address Node)
 
void PAppend (TCollection_BaseSequence &S)
 Concatenates <S> at the end of <me>. <S> is cleared. Example: before me = (A B C) S = (D E F) after me = (A B C D E F) S = () More...
 
void PPrepend (const Standard_Address Node)
 
void PPrepend (TCollection_BaseSequence &S)
 Concatenates <S> at the beginning of <me>. <S> is cleared. Example: before me = (A B C) S = (D E F) after me = (D E F A B C) S = () More...
 
void PInsertAfter (const Standard_Integer Index, const Standard_Address Node)
 
void PInsertAfter (const Standard_Integer Index, TCollection_BaseSequence &S)
 Inserts the sequence <S> in <me> after the position <Index>. <S> is cleared. Raises an exception if the index is out of bound. Example: before me = (A B C), Index = 3, S = (D E F) after me = (A B C D E F) S = () More...
 
void PSplit (const Standard_Integer Index, TCollection_BaseSequence &Sub)
 Keeps in <me> the items 1 to <Index>-1 and puts in the items <Index> to the end. Example: before me = (A B C D) ,Index = 3 after me = (A B) Sub = (C D) More...
 
void Remove (const Standard_Integer Index, const Standard_Address DelNode)
 
void Remove (const Standard_Integer FromIndex, const Standard_Integer ToIndex, const Standard_Address DelNode)
 
Standard_Address Find (const Standard_Integer Index) const
 Returns the node at position <index>. More...
 

Protected Attributes

Standard_Address FirstItem
 
Standard_Address LastItem
 
Standard_Address CurrentItem
 
Standard_Integer CurrentIndex
 
Standard_Integer Size
 

Detailed Description

Definition of a base class for all instanciations of sequence.

The methods : Clear, Remove accepts a pointer to a function to use to delete the nodes. This allow proper call of the destructor on the Items. Without adding a virtual function pointer to each node or each sequence.

Constructor & Destructor Documentation

◆ TCollection_BaseSequence()

TCollection_BaseSequence::TCollection_BaseSequence ( )
protected

Creation of an empty sequence.

Member Function Documentation

◆ Clear()

void TCollection_BaseSequence::Clear ( const Standard_Address  DelNode)
protected

◆ Exchange()

void TCollection_BaseSequence::Exchange ( const Standard_Integer  I,
const Standard_Integer  J 
)

Swaps elements which are located at positions and <J> in <me>. Raises an exception if I or J is out of bound. Example: before me = (A B C), I = 1, J = 3 after me = (C B A)

◆ Find()

Standard_Address TCollection_BaseSequence::Find ( const Standard_Integer  Index) const
protected

Returns the node at position <index>.

◆ IsEmpty()

Standard_Boolean TCollection_BaseSequence::IsEmpty ( ) const

returns True if the sequence <me> contains no elements.

◆ Length()

Standard_Integer TCollection_BaseSequence::Length ( ) const

Returns the number of element(s) in the sequence. Returns zero if the sequence is empty.

◆ PAppend() [1/2]

void TCollection_BaseSequence::PAppend ( const Standard_Address  Node)
protected

◆ PAppend() [2/2]

void TCollection_BaseSequence::PAppend ( TCollection_BaseSequence S)
protected

Concatenates <S> at the end of <me>. <S> is cleared. Example: before me = (A B C) S = (D E F) after me = (A B C D E F) S = ()

◆ PInsertAfter() [1/2]

void TCollection_BaseSequence::PInsertAfter ( const Standard_Integer  Index,
const Standard_Address  Node 
)
protected

◆ PInsertAfter() [2/2]

void TCollection_BaseSequence::PInsertAfter ( const Standard_Integer  Index,
TCollection_BaseSequence S 
)
protected

Inserts the sequence <S> in <me> after the position <Index>. <S> is cleared. Raises an exception if the index is out of bound. Example: before me = (A B C), Index = 3, S = (D E F) after me = (A B C D E F) S = ()

◆ PPrepend() [1/2]

void TCollection_BaseSequence::PPrepend ( const Standard_Address  Node)
protected

◆ PPrepend() [2/2]

void TCollection_BaseSequence::PPrepend ( TCollection_BaseSequence S)
protected

Concatenates <S> at the beginning of <me>. <S> is cleared. Example: before me = (A B C) S = (D E F) after me = (D E F A B C) S = ()

◆ PSplit()

void TCollection_BaseSequence::PSplit ( const Standard_Integer  Index,
TCollection_BaseSequence Sub 
)
protected

Keeps in <me> the items 1 to <Index>-1 and puts in the items <Index> to the end. Example: before me = (A B C D) ,Index = 3 after me = (A B) Sub = (C D)

◆ Remove() [1/2]

void TCollection_BaseSequence::Remove ( const Standard_Integer  Index,
const Standard_Address  DelNode 
)
protected

◆ Remove() [2/2]

void TCollection_BaseSequence::Remove ( const Standard_Integer  FromIndex,
const Standard_Integer  ToIndex,
const Standard_Address  DelNode 
)
protected

◆ Reverse()

void TCollection_BaseSequence::Reverse ( )

Reverses the order of items on <me>. Example: before me = (A B C) after me = (C B A)

Field Documentation

◆ CurrentIndex

Standard_Integer TCollection_BaseSequence::CurrentIndex
protected

◆ CurrentItem

Standard_Address TCollection_BaseSequence::CurrentItem
protected

◆ FirstItem

Standard_Address TCollection_BaseSequence::FirstItem
protected

◆ LastItem

Standard_Address TCollection_BaseSequence::LastItem
protected

◆ Size

Standard_Integer TCollection_BaseSequence::Size
protected

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