|
| friend | iterator |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| friend | const_iterator |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| vector | myContainer |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| allocator_type | myAlloc |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| size_t | myInternalSize |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| size_t | myBlockShift |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| size_t | myBlockMask |
| | myInternalSize - 1 for fast index-within-block mapping
|
| |
| size_t | myUsedSize |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const size_t theIncrement) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const int theIncrement=256) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const size_t theIncrement, const occ::handle< NCollection_BaseAllocator > &theAllocator) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const int theIncrement, const occ::handle< NCollection_BaseAllocator > &theAllocator) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const size_t theIncrement, const allocator_type &theAllocator) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const int theIncrement, const allocator_type &theAllocator) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | NCollection_DynamicArray (const NCollection_DynamicArray &theOther) |
| | Copy constructor.
|
| |
| | NCollection_DynamicArray (NCollection_DynamicArray &&theOther) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| | ~NCollection_DynamicArray () |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| size_t | Size () const noexcept |
| | Total number of items in the vector.
|
| |
| int | Length () const noexcept |
| | Total number of items (legacy int-returning API).
|
| |
| int | Lower () const noexcept |
| | Method for consistency with other collections.
|
| |
| int | Upper () const noexcept |
| | Method for consistency with other collections.
|
| |
| bool | IsEmpty () const noexcept |
| | 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) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| 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.
|
| |
| reference | InsertAfter (const size_t theIndex, const TheItemType &theValue) |
| | Insert a value after the element at theIndex, shifting subsequent elements right.
|
| |
| reference | InsertAfter (const size_t theIndex, TheItemType &&theValue) |
| | Insert a value after the element at theIndex (move version).
|
| |
| reference | InsertAfter (const int theIndex, const TheItemType &theValue) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | InsertAfter (const int theIndex, TheItemType &&theValue) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | InsertBefore (const size_t theIndex, const TheItemType &theValue) |
| | Insert a value before the element at theIndex, shifting it and subsequent elements right.
|
| |
| reference | InsertBefore (const size_t theIndex, TheItemType &&theValue) |
| | Insert a value before the element at theIndex (move version).
|
| |
| reference | InsertBefore (const int theIndex, const TheItemType &theValue) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | InsertBefore (const int theIndex, TheItemType &&theValue) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| void | EraseLast () |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | Appended () |
| | Appends an empty value and returns the reference to it.
|
| |
| template<typename... Args> |
| reference | EmplaceAppend (Args &&... theArgs) |
| | Emplace one item at the end, constructing it in-place.
|
| |
| template<typename... Args> |
| reference | EmplaceValue (const size_t theIndex, Args &&... theArgs) |
| | Emplace value at the specified index, constructing it in-place If the index is beyond current size, default-constructs intermediate elements.
|
| |
| template<typename... Args> |
| reference | EmplaceValue (const int theIndex, Args &&... theArgs) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| const_reference | operator() (const size_t theIndex) const noexcept |
| | Operator() - query the const value.
|
| |
| const_reference | operator() (const int theIndex) const noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| const_reference | operator[] (const size_t theIndex) const noexcept |
| | Operator[] - query the const value.
|
| |
| const_reference | operator[] (const int theIndex) const noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| const_reference | Value (const size_t theIndex) const noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| const_reference | Value (const int theIndex) const noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| const_reference | First () const noexcept |
| |
| reference | ChangeFirst () noexcept |
| |
| const_reference | Last () const noexcept |
| |
| reference | ChangeLast () noexcept |
| |
| reference | operator() (const size_t theIndex) noexcept |
| | Operator() - query the value.
|
| |
| reference | operator() (const int theIndex) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | operator[] (const size_t theIndex) noexcept |
| | Operator[] - query the value.
|
| |
| reference | operator[] (const int theIndex) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | ChangeValue (const size_t theIndex) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | ChangeValue (const int theIndex) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | SetValue (const size_t theIndex, const TheItemType &theValue) |
| | SetValue () - set or append a value.
|
| |
| reference | SetValue (const size_t theIndex, TheItemType &&theValue) |
| | SetValue () - set or append a value.
|
| |
| reference | SetValue (const int theIndex, const TheItemType &theValue) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | SetValue (const int theIndex, TheItemType &&theValue) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| void | Clear (const bool theReleaseMemory=false) |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| void | SetIncrement (const size_t theIncrement) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| void | SetIncrement (const int theIncrement) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| size_t | availableSize () const noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| void | ensureStorageForIndex (const size_t theIndex) |
| | Ensure storage blocks exist to access theIndex.
|
| |
| void | ensureBlockCount (const size_t theBlockCount) |
| | Ensure at least theBlockCount blocks are allocated in myContainer.
|
| |
| TheItemType * | expandArray () |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| reference | at (const size_t theInd) noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| const_reference | at (const size_t theInd) const noexcept |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| void | copyDate () |
| | log2(myInternalSize) for fast index-to-block mapping
|
| |
| TheItemType ** | getArray () noexcept |
| | Wrapper to extract array of block pointers.
|
| |
| TheItemType *const * | getArray () const noexcept |
| | Wrapper to extract array of block pointers (const overload).
|
| |
| static constexpr size_t | roundUpPow2 (const size_t theValue) noexcept |
| | Round up to the nearest power of 2 (returns theValue if already power of 2). Works correctly for both 32-bit and 64-bit size_t.
|
| |
| static constexpr size_t | log2Pow2 (const size_t theValue) noexcept |
| | Compute log2 of a power-of-2 value.
|
| |
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:
- Calling the method Append (val) - then "val" is added to the end of the vector (the vector length is incremented)
- Calling the method SetValue (i, val) - if "i" is greater than or equal to the current length of the vector, the vector is enlarged to accomo- date this index
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.