Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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.
 
typedef NCollection_StlIterator< std::bidirectional_iterator_tag, Iterator, TheItemType, falseiterator
 Shorthand for a regular iterator type.
 
typedef NCollection_StlIterator< std::bidirectional_iterator_tag, Iterator, TheItemType, trueconst_iterator
 Shorthand for a constant iterator type.
 

Public Member Functions

iterator begin () const noexcept
 Returns an iterator pointing to the first element in the sequence.
 
iterator end () const noexcept
 Returns an iterator referring to the past-the-end element in the sequence.
 
const_iterator cbegin () const noexcept
 Returns a const iterator pointing to the first element in the sequence.
 
const_iterator cend () const noexcept
 Returns a const iterator referring to the past-the-end element in the sequence.
 
 NCollection_Sequence ()
 Empty constructor.
 
 NCollection_Sequence (const occ::handle< NCollection_BaseAllocator > &theAllocator)
 Constructor.
 
 NCollection_Sequence (const NCollection_Sequence &theOther)
 Copy constructor.
 
 NCollection_Sequence (NCollection_Sequence &&theOther) noexcept
 Move constructor.
 
int Upper () const noexcept
 Method for consistency with other collections.
 
bool IsEmpty () const noexcept
 Empty query.
 
void Reverse ()
 Reverse sequence.
 
void Exchange (const size_t I, const size_t J)
 Exchange two members.
 
void Exchange (const int I, const int J)
 
void Clear (const occ::handle< NCollection_BaseAllocator > &theAllocator=nullptr)
 Clear the items out, take a new allocator if non null.
 
NCollection_SequenceAssign (const NCollection_Sequence &theOther)
 Replace this sequence by the items of theOther. This method does not change the internal allocator.
 
NCollection_Sequenceoperator= (const NCollection_Sequence &theOther)
 Replacement operator.
 
NCollection_Sequenceoperator= (NCollection_Sequence &&theOther) noexcept
 Move operator.
 
void Remove (Iterator &thePosition)
 Remove one item.
 
void Remove (const size_t theIndex)
 Remove one item.
 
void Remove (const int theIndex)
 
void Remove (const size_t theFromIndex, const size_t theToIndex)
 Remove range of items.
 
void Remove (const int theFromIndex, const int theToIndex)
 
void Append (const TheItemType &theItem)
 Append one item.
 
void Append (TheItemType &&theItem)
 Append one item.
 
void Append (NCollection_Sequence &theSeq)
 Append another sequence (making it empty)
 
void Prepend (const TheItemType &theItem)
 Prepend one item.
 
void Prepend (TheItemType &&theItem)
 Prepend one item.
 
void Prepend (NCollection_Sequence &theSeq)
 Prepend another sequence (making it empty)
 
void InsertBefore (const size_t theIndex, const TheItemType &theItem)
 InsertBefore theIndex theItem.
 
void InsertBefore (const int theIndex, const TheItemType &theItem)
 
void InsertBefore (const size_t theIndex, TheItemType &&theItem)
 InsertBefore theIndex theItem.
 
void InsertBefore (const int theIndex, TheItemType &&theItem)
 
void InsertBefore (const size_t theIndex, NCollection_Sequence &theSeq)
 InsertBefore theIndex another sequence (making it empty)
 
void InsertBefore (const int theIndex, NCollection_Sequence &theSeq)
 
void InsertAfter (Iterator &thePosition, const TheItemType &theItem)
 InsertAfter the position of iterator.
 
void InsertAfter (Iterator &thePosition, TheItemType &&theItem)
 InsertAfter the position of iterator.
 
void InsertAfter (const size_t theIndex, NCollection_Sequence &theSeq)
 InsertAfter theIndex another sequence (making it empty)
 
void InsertAfter (const int theIndex, NCollection_Sequence &theSeq)
 
void InsertAfter (const size_t theIndex, const TheItemType &theItem)
 InsertAfter theIndex theItem.
 
void InsertAfter (const int theIndex, const TheItemType &theItem)
 
void InsertAfter (const size_t theIndex, TheItemType &&theItem)
 InsertAfter theIndex theItem.
 
void InsertAfter (const int theIndex, TheItemType &&theItem)
 
template<typename... Args>
TheItemTypeEmplaceAppend (Args &&... theArgs)
 Emplace one item at the end, constructing it in-place.
 
template<typename... Args>
TheItemTypeEmplacePrepend (Args &&... theArgs)
 Emplace one item at the beginning, constructing it in-place.
 
template<typename... Args>
TheItemTypeEmplaceAfter (Iterator &thePosition, Args &&... theArgs)
 Emplace one item after the position of iterator, constructing it in-place.
 
template<typename... Args>
TheItemTypeEmplaceAfter (const size_t theIndex, Args &&... theArgs)
 Emplace one item after the specified index, constructing it in-place.
 
template<typename... Args>
TheItemTypeEmplaceAfter (const int theIndex, Args &&... theArgs)
 
template<typename... Args>
TheItemTypeEmplaceBefore (const size_t theIndex, Args &&... theArgs)
 Emplace one item before the specified index, constructing it in-place.
 
template<typename... Args>
TheItemTypeEmplaceBefore (const int theIndex, Args &&... theArgs)
 
void Split (const size_t theIndex, NCollection_Sequence &theSeq)
 Split in two sequences.
 
void Split (const int theIndex, NCollection_Sequence &theSeq)
 
const TheItemTypeFirst () const
 First item access.
 
TheItemTypeChangeFirst ()
 First item access.
 
const TheItemTypeLast () const
 Last item access.
 
TheItemTypeChangeLast ()
 Last item access.
 
const TheItemTypeValue (const size_t theIndex) const
 Constant item access by theIndex.
 
const TheItemTypeValue (const int theIndex) const
 
const TheItemTypeoperator() (const size_t theIndex) const
 Constant operator()
 
const TheItemTypeoperator() (const int theIndex) const
 
TheItemTypeChangeValue (const size_t theIndex)
 Variable item access by theIndex.
 
TheItemTypeChangeValue (const int theIndex)
 
TheItemTypeoperator() (const size_t theIndex)
 Variable operator()
 
TheItemTypeoperator() (const int theIndex)
 
void SetValue (const size_t theIndex, const TheItemType &theItem)
 Set item value by theIndex.
 
void SetValue (const int theIndex, const TheItemType &theItem)
 
const TheItemTypeAt (const size_t theIndex) const
 0-based checked access independent of Lower()/Upper().
 
TheItemTypeChangeAt (const size_t theIndex)
 0-based checked mutable access independent of Lower()/Upper().
 
 ~NCollection_Sequence () override
 
- Public Member Functions inherited from NCollection_BaseSequence
bool IsEmpty () const noexcept
 
int Length () const noexcept
 Number of items (legacy int-returning API).
 
size_t Size () const noexcept
 Size - number of items.
 
const occ::handle< NCollection_BaseAllocator > & Allocator () const noexcept
 Returns attached allocator.
 

Static Public Member Functions

static constexpr int Lower () noexcept
 Method for consistency with other collections.
 
static void delNode (NCollection_SeqNode *theNode, occ::handle< NCollection_BaseAllocator > &theAl)
 Static deleter to be passed to BaseSequence.
 

Additional Inherited Members

- Protected Member Functions inherited from NCollection_BaseSequence
 NCollection_BaseSequence (const occ::handle< NCollection_BaseAllocator > &theAllocator)
 
virtual ~NCollection_BaseSequence ()=default
 Destructor.
 
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 size_t Index, NCollection_SeqNode *)
 
void PInsertAfter (const size_t Index, NCollection_BaseSequence &S)
 
void PSplit (const size_t Index, NCollection_BaseSequence &Sub)
 
void RemoveSeq (Iterator &thePosition, NCollection_DelSeqNode fDel)
 
void RemoveSeq (const size_t Index, NCollection_DelSeqNode fDel)
 
void RemoveSeq (const size_t From, const size_t To, NCollection_DelSeqNode fDel)
 
void PReverse () noexcept
 
void PExchange (const size_t I, const size_t J)
 
NCollection_SeqNodeFind (const size_t) const noexcept
 
- Protected Attributes inherited from NCollection_BaseSequence
occ::handle< NCollection_BaseAllocatormyAllocator
 
NCollection_SeqNodemyFirstItem
 
NCollection_SeqNodemyLastItem
 
NCollection_SeqNodemyCurrentItem
 
size_t myCurrentIndex
 
size_t 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

◆ const_iterator

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

Shorthand for a constant iterator type.

◆ iterator

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

Shorthand for a regular iterator type.

◆ value_type

STL-compliant typedef for value type.

Constructor & Destructor Documentation

◆ NCollection_Sequence() [1/4]

Empty constructor.

◆ NCollection_Sequence() [2/4]

Constructor.

◆ NCollection_Sequence() [3/4]

Copy constructor.

◆ NCollection_Sequence() [4/4]

Move constructor.

◆ ~NCollection_Sequence()

Member Function Documentation

◆ Append() [1/3]

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

Append one item.

◆ Append() [2/3]

Append another sequence (making it empty)

◆ Append() [3/3]

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

Append one item.

◆ Assign()

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

◆ At()

template<class TheItemType >
const TheItemType & NCollection_Sequence< TheItemType >::At ( const size_t theIndex) const
inline

0-based checked access independent of Lower()/Upper().

Parameters
[in]theIndex0-based index in [0, Size()-1]

◆ begin()

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

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

◆ cbegin()

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

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

◆ cend()

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

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

◆ ChangeAt()

template<class TheItemType >
TheItemType & NCollection_Sequence< TheItemType >::ChangeAt ( const size_t theIndex)
inline

0-based checked mutable access independent of Lower()/Upper().

Parameters
[in]theIndex0-based index in [0, Size()-1]

◆ ChangeFirst()

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

First item access.

◆ ChangeLast()

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

Last item access.

◆ ChangeValue() [1/2]

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

◆ ChangeValue() [2/2]

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

Variable item access by theIndex.

◆ Clear()

template<class TheItemType >
void NCollection_Sequence< TheItemType >::Clear ( const occ::handle< NCollection_BaseAllocator > & theAllocator = nullptr)
inline

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

◆ delNode()

Static deleter to be passed to BaseSequence.

◆ EmplaceAfter() [1/3]

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplaceAfter ( const int theIndex,
Args &&... theArgs )
inline

◆ EmplaceAfter() [2/3]

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplaceAfter ( const size_t theIndex,
Args &&... theArgs )
inline

Emplace one item after the specified index, constructing it in-place.

Parameters
theIndexindex after which to insert (0 means insert at beginning)
theArgsarguments forwarded to TheItemType constructor
Returns
reference to the newly constructed item

◆ EmplaceAfter() [3/3]

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplaceAfter ( Iterator & thePosition,
Args &&... theArgs )
inline

Emplace one item after the position of iterator, constructing it in-place.

Parameters
thePositioniterator pointing to the position after which to insert
theArgsarguments forwarded to TheItemType constructor
Returns
reference to the newly constructed item

◆ EmplaceAppend()

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplaceAppend ( Args &&... theArgs)
inline

Emplace one item at the end, constructing it in-place.

Parameters
theArgsarguments forwarded to TheItemType constructor
Returns
reference to the newly constructed item

◆ EmplaceBefore() [1/2]

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplaceBefore ( const int theIndex,
Args &&... theArgs )
inline

◆ EmplaceBefore() [2/2]

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplaceBefore ( const size_t theIndex,
Args &&... theArgs )
inline

Emplace one item before the specified index, constructing it in-place.

Parameters
theIndexindex before which to insert
theArgsarguments forwarded to TheItemType constructor
Returns
reference to the newly constructed item

◆ EmplacePrepend()

template<class TheItemType >
template<typename... Args>
TheItemType & NCollection_Sequence< TheItemType >::EmplacePrepend ( Args &&... theArgs)
inline

Emplace one item at the beginning, constructing it in-place.

Parameters
theArgsarguments forwarded to TheItemType constructor
Returns
reference to the newly constructed item

◆ end()

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

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

◆ Exchange() [1/2]

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

◆ Exchange() [2/2]

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

Exchange two members.

◆ First()

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

First item access.

◆ InsertAfter() [1/8]

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

◆ InsertAfter() [2/8]

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

◆ InsertAfter() [3/8]

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

◆ InsertAfter() [4/8]

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

InsertAfter theIndex theItem.

◆ InsertAfter() [5/8]

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

InsertAfter theIndex another sequence (making it empty)

◆ InsertAfter() [6/8]

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

InsertAfter theIndex theItem.

◆ InsertAfter() [7/8]

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

InsertAfter the position of iterator.

◆ InsertAfter() [8/8]

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

InsertAfter the position of iterator.

◆ InsertBefore() [1/6]

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

◆ InsertBefore() [2/6]

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

◆ InsertBefore() [3/6]

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

◆ InsertBefore() [4/6]

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

InsertBefore theIndex theItem.

◆ InsertBefore() [5/6]

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

InsertBefore theIndex another sequence (making it empty)

◆ InsertBefore() [6/6]

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

InsertBefore theIndex theItem.

◆ IsEmpty()

template<class TheItemType >
bool NCollection_Sequence< TheItemType >::IsEmpty ( ) const
inlinenoexcept

Empty query.

◆ Last()

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

Last item access.

◆ Lower()

template<class TheItemType >
static constexpr int NCollection_Sequence< TheItemType >::Lower ( )
inlinestaticconstexprnoexcept

Method for consistency with other collections.

Returns
Lower bound (inclusive) for iteration.

◆ operator()() [1/4]

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

◆ operator()() [2/4]

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

◆ operator()() [3/4]

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

Variable operator()

◆ operator()() [4/4]

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

Constant operator()

◆ operator=() [1/2]

Replacement operator.

◆ operator=() [2/2]

Move operator.

◆ Prepend() [1/3]

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

Prepend one item.

◆ Prepend() [2/3]

Prepend another sequence (making it empty)

◆ Prepend() [3/3]

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

Prepend one item.

◆ Remove() [1/5]

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

◆ Remove() [2/5]

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

◆ Remove() [3/5]

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

Remove range of items.

◆ Remove() [4/5]

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

Remove one item.

◆ Remove() [5/5]

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

Remove one item.

◆ Reverse()

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

Reverse sequence.

◆ SetValue() [1/2]

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

◆ SetValue() [2/2]

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

Set item value by theIndex.

◆ Split() [1/2]

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

◆ Split() [2/2]

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

Split in two sequences.

◆ Upper()

template<class TheItemType >
int NCollection_Sequence< TheItemType >::Upper ( ) const
inlinenoexcept

Method for consistency with other collections.

Returns
Upper bound (inclusive) for iteration.

◆ Value() [1/2]

template<class TheItemType >
const TheItemType & NCollection_Sequence< TheItemType >::Value ( const int theIndex) const
inline

◆ Value() [2/2]

template<class TheItemType >
const TheItemType & NCollection_Sequence< TheItemType >::Value ( const size_t theIndex) const
inline

Constant item access by theIndex.


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