Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions
NCollection_HSequence< TheItemType > Class Template Reference

Template class for Handle-managed sequences. Inherits from both NCollection_Sequence<TheItemType> and Standard_Transient, providing reference-counted sequence functionality. More...

#include <NCollection_HSequence.hxx>

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

Public Types

typedef NCollection_Sequence< TheItemTypeSequenceType
 
typedef TheItemType value_type
 
- Public Types inherited from NCollection_Sequence< TheItemType >
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 Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Public Member Functions

 NCollection_HSequence ()=default
 Default constructor.
 
 NCollection_HSequence (const SequenceType &theOther)
 Copy constructor from sequence.
 
const SequenceTypeSequence () const noexcept
 Returns const reference to the underlying sequence.
 
SequenceTypeChangeSequence () noexcept
 Returns mutable reference to the underlying sequence.
 
void Append (const TheItemType &theItem)
 Append single item.
 
void Append (SequenceType &theSequence)
 Append another sequence.
 
template<class T >
void Append (const opencascade::handle< T > &theOther, typename std::enable_if< std::is_base_of< NCollection_HSequence, T >::value >::type *=nullptr)
 Append items from another HSequence.
 
- Public Member Functions inherited from NCollection_Sequence< TheItemType >
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.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Static Public Member Functions inherited from NCollection_Sequence< TheItemType >
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.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 
- 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<typename TheItemType>
class NCollection_HSequence< TheItemType >

Template class for Handle-managed sequences. Inherits from both NCollection_Sequence<TheItemType> and Standard_Transient, providing reference-counted sequence functionality.

Member Typedef Documentation

◆ SequenceType

◆ value_type

Constructor & Destructor Documentation

◆ NCollection_HSequence() [1/2]

Default constructor.

◆ NCollection_HSequence() [2/2]

Copy constructor from sequence.

Parameters
theOtherthe sequence to copy from

Member Function Documentation

◆ Append() [1/3]

template<typename TheItemType >
template<class T >
void NCollection_HSequence< TheItemType >::Append ( const opencascade::handle< T > & theOther,
typename std::enable_if< std::is_base_of< NCollection_HSequence< TheItemType >, T >::value >::type * = nullptr )
inline

Append items from another HSequence.

Parameters
theOtherhandle to another HSequence

◆ Append() [2/3]

template<typename TheItemType >
void NCollection_HSequence< TheItemType >::Append ( const TheItemType & theItem)
inline

Append single item.

Parameters
theItemthe item to append

◆ Append() [3/3]

template<typename TheItemType >
void NCollection_HSequence< TheItemType >::Append ( SequenceType & theSequence)
inline

Append another sequence.

Parameters
theSequencethe sequence to append

◆ ChangeSequence()

template<typename TheItemType >
SequenceType & NCollection_HSequence< TheItemType >::ChangeSequence ( )
inlinenoexcept

Returns mutable reference to the underlying sequence.

◆ Sequence()

template<typename TheItemType >
const SequenceType & NCollection_HSequence< TheItemType >::Sequence ( ) const
inlinenoexcept

Returns const reference to the underlying sequence.


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