Open CASCADE Technology 7.8.2.dev
|
Class NCollection_DynamicArray (dynamic array of objects) More...
#include <NCollection_DynamicArray.hxx>
Public Types | |
typedef NCollection_OccAllocator< TheItemType > | allocator_type |
Memory allocation. | |
typedef NCollection_BasePointerVector | vector |
using | value_type = TheItemType |
using | size_type = size_t |
using | difference_type = size_t |
using | pointer = TheItemType* |
using | const_pointer = TheItemType& |
using | reference = TheItemType& |
using | const_reference = const TheItemType& |
using | iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_DynamicArray, value_type, false> |
using | const_iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_DynamicArray, value_type, true> |
using | Iterator = NCollection_Iterator<NCollection_DynamicArray<TheItemType>> |
Public Member Functions | |
const_iterator | begin () const |
iterator | begin () |
const_iterator | cbegin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cend () const |
public methods | |
friend | iterator |
Copy constructor. | |
friend | const_iterator |
Copy constructor. | |
vector | myContainer |
Copy constructor. | |
allocator_type | myAlloc |
Copy constructor. | |
size_t | myInternalSize |
Copy constructor. | |
size_t | myUsedSize |
Copy constructor. | |
NCollection_DynamicArray (const Standard_Integer theIncrement=256) | |
Copy constructor. | |
NCollection_DynamicArray (const Standard_Integer theIncrement, const Handle< NCollection_BaseAllocator > &theAllocator) | |
Copy constructor. | |
NCollection_DynamicArray (const Standard_Integer theIncrement, const allocator_type &theAllocator) | |
Copy constructor. | |
NCollection_DynamicArray (const NCollection_DynamicArray &theOther) | |
Copy constructor. | |
NCollection_DynamicArray (NCollection_DynamicArray &&theOther) noexcept | |
Copy constructor. | |
~NCollection_DynamicArray () | |
Copy constructor. | |
Standard_Integer | Length () const |
Total number of items. | |
Standard_Integer | Size () const |
Total number of items in the vector. | |
Standard_Integer | Lower () const |
Method for consistency with other collections. | |
Standard_Integer | Upper () const |
Method for consistency with other collections. | |
Standard_Boolean | IsEmpty () const |
Empty query. | |
NCollection_DynamicArray & | Assign (const NCollection_DynamicArray &theOther, const bool theOwnAllocator=true) |
Assignment to the collection of the same type. | |
NCollection_DynamicArray & | Assign (NCollection_DynamicArray &&theOther) |
Copy constructor. | |
NCollection_DynamicArray & | operator= (const NCollection_DynamicArray &theOther) |
Assignment operator. | |
NCollection_DynamicArray & | operator= (NCollection_DynamicArray &&theOther) noexcept |
Assignment operator. | |
reference | Append (const TheItemType &theValue) |
Append. | |
reference | Append (TheItemType &&theValue) |
Append. | |
void | EraseLast () |
Copy constructor. | |
reference | Appended () |
Appends an empty value and returns the reference to it. | |
const_reference | operator() (const Standard_Integer theIndex) const |
Operator() - query the const value. | |
const_reference | operator[] (const Standard_Integer theIndex) const |
Operator[] - query the const value. | |
const_reference | operator[] (const size_t theIndex) const |
Operator[] - query the const value. | |
const_reference | Value (const Standard_Integer theIndex) const |
Copy constructor. | |
const_reference | First () const |
reference | ChangeFirst () |
const_reference | Last () const |
reference | ChangeLast () |
reference | operator() (const Standard_Integer theIndex) |
Operator() - query the value. | |
reference | operator[] (const Standard_Integer theIndex) |
Operator[] - query the value. | |
reference | operator[] (const size_t theIndex) |
Operator[] - query the value. | |
reference | ChangeValue (const Standard_Integer theIndex) |
Copy constructor. | |
reference | SetValue (const Standard_Integer theIndex, const TheItemType &theValue) |
SetValue () - set or append a value. | |
reference | SetValue (const Standard_Integer theIndex, TheItemType &&theValue) |
SetValue () - set or append a value. | |
void | Clear (const bool theReleaseMemory=false) |
Copy constructor. | |
void | SetIncrement (const Standard_Integer theIncrement) |
Copy constructor. | |
size_t | availableSize () const |
Copy constructor. | |
TheItemType * | expandArray () |
Copy constructor. | |
reference | at (const size_t theInd) |
Copy constructor. | |
const_reference | at (const size_t theInd) const |
Copy constructor. | |
void | copyDate () |
Copy constructor. | |
TheItemType ** | getArray () const |
Wrapper to extract array. | |
Class NCollection_DynamicArray (dynamic array of objects)
The array's indices always start at 0.
The Vector is always created with 0 length. It can be enlarged by two means:
The methods Append and SetValue return a non-const reference to the copied object inside the vector. This reference is guaranteed to be valid until the vector is destroyed. It can be used to access the vector member directly or to pass its address to other data structures.
The vector iterator remembers the length of the vector at the moment of the creation or initialisation of the iterator. Therefore the iteration begins at index 0 and stops at the index equal to (remembered_length-1). It is OK to enlarge the vector during the iteration.
NCollection_OccAllocator<TheItemType> NCollection_DynamicArray< TheItemType >::allocator_type |
Memory allocation.
using NCollection_DynamicArray< TheItemType >::const_iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_DynamicArray, value_type, true> |
using NCollection_DynamicArray< TheItemType >::const_pointer = TheItemType& |
using NCollection_DynamicArray< TheItemType >::const_reference = const TheItemType& |
using NCollection_DynamicArray< TheItemType >::difference_type = size_t |
using NCollection_DynamicArray< TheItemType >::Iterator = NCollection_Iterator<NCollection_DynamicArray<TheItemType>> |
using NCollection_DynamicArray< TheItemType >::iterator = NCollection_IndexedIterator<std::random_access_iterator_tag, NCollection_DynamicArray, value_type, false> |
using NCollection_DynamicArray< TheItemType >::pointer = TheItemType* |
using NCollection_DynamicArray< TheItemType >::reference = TheItemType& |
using NCollection_DynamicArray< TheItemType >::size_type = size_t |
using NCollection_DynamicArray< TheItemType >::value_type = TheItemType |
NCollection_BasePointerVector NCollection_DynamicArray< TheItemType >::vector |
|
inline |
Copy constructor.
|
inlineexplicit |
Copy constructor.
|
inlineexplicit |
Copy constructor.
|
inline |
Copy constructor.
|
inlinenoexcept |
Copy constructor.
|
inline |
Copy constructor.
|
inline |
Append.
|
inline |
Append.
|
inline |
Appends an empty value and returns the reference to it.
|
inline |
Assignment to the collection of the same type.
|
inline |
Copy constructor.
|
inlineprotected |
Copy constructor.
|
inlineprotected |
Copy constructor.
|
inlineprotected |
Copy constructor.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Copy constructor.
|
inline |
Copy constructor.
|
inlineprotected |
Copy constructor.
|
inline |
|
inline |
|
inline |
Copy constructor.
|
inlineprotected |
Copy constructor.
|
inline |
|
inlineprotected |
Wrapper to extract array.
|
inline |
Empty query.
|
inline |
|
inline |
Total number of items.
|
inline |
Method for consistency with other collections.
|
inline |
Operator() - query the value.
|
inline |
Operator() - query the const value.
|
inline |
Assignment operator.
|
inlinenoexcept |
Assignment operator.
|
inline |
Operator[] - query the value.
|
inline |
Operator[] - query the const value.
|
inline |
Operator[] - query the value.
|
inline |
Operator[] - query the const value.
|
inline |
Copy constructor.
|
inline |
SetValue () - set or append a value.
|
inline |
SetValue () - set or append a value.
|
inline |
Total number of items in the vector.
|
inline |
Method for consistency with other collections.
|
inline |
Copy constructor.
friend NCollection_DynamicArray< TheItemType >::const_iterator |
Copy constructor.
friend NCollection_DynamicArray< TheItemType >::iterator |
Copy constructor.
|
protected |
Copy constructor.
|
protected |
Copy constructor.
|
protected |
Copy constructor.
|
protected |
Copy constructor.