|
| const_iterator | begin () const noexcept |
| |
| iterator | begin () noexcept |
| |
| const_iterator | cbegin () const noexcept |
| |
| iterator | end () noexcept |
| |
| const_iterator | end () const noexcept |
| |
| const_iterator | cend () const noexcept |
| |
| | NCollection_Array1 () noexcept |
| |
| | NCollection_Array1 (const int theLower, const int theUpper) |
| |
| | NCollection_Array1 (const_reference theBegin, const int theLower, const int theUpper, const bool theUseBuffer=true) |
| |
| | NCollection_Array1 (const size_t theSize) |
| | Zero-based constructor: allocates theSize elements with lower bound 0. Use At()/ChangeAt() or STL iterators for optimal access (no offset subtraction).
|
| |
| | NCollection_Array1 (pointer theBegin, const size_t theSize) |
| | Zero-based buffer-reuse constructor: wraps an existing C array of theSize elements. The array does NOT own the buffer and will NOT free it on destruction. Use At()/ChangeAt() or STL iterators for optimal access (no offset subtraction).
|
| |
| | NCollection_Array1 (const NCollection_Array1 &theOther) |
| | Copy constructor.
|
| |
| | NCollection_Array1 (NCollection_Array1 &&theOther) noexcept |
| | Move constructor.
|
| |
| virtual | ~NCollection_Array1 () |
| |
| void | Init (const_reference theValue) |
| | Initialise the items with theValue.
|
| |
| size_t | Size () const noexcept |
| | Size query.
|
| |
| int | Length () const noexcept |
| | Length query (legacy int-returning API).
|
| |
| bool | IsEmpty () const noexcept |
| | Return TRUE if array has zero length.
|
| |
| int | Lower () const noexcept |
| | Lower bound.
|
| |
| int | Upper () const noexcept |
| | Upper bound.
|
| |
| NCollection_Array1 & | Assign (const NCollection_Array1 &theOther) |
| | Replaces this array by a copy of theOther array. Bounds and length are copied from theOther. When this array wraps an external (non-owned) buffer:
|
| |
| NCollection_Array1 & | CopyValues (const NCollection_Array1 &theOther) |
| | Copies values from theOther array without changing this array bounds. This array should be pre-allocated and have the same length as theOther; otherwise exception Standard_DimensionMismatch is thrown.
|
| |
| NCollection_Array1 & | Move (NCollection_Array1 &&theOther) noexcept |
| | Move assignment. This array will borrow all the data from theOther. The moved object will keep pointer to the memory buffer and range, but it will not free the buffer on destruction.
|
| |
| NCollection_Array1 & | Move (NCollection_Array1 &theOther) noexcept |
| |
| NCollection_Array1 & | operator= (const NCollection_Array1 &theOther) |
| | Assignment operator;.
|
| |
| NCollection_Array1 & | operator= (NCollection_Array1 &&theOther) noexcept |
| | Move assignment operator;.
|
| |
| const_reference | First () const noexcept |
| |
| reference | ChangeFirst () noexcept |
| |
| const_reference | Last () const noexcept |
| |
| reference | ChangeLast () noexcept |
| |
| const_reference | Value (const int theIndex) const |
| | Constant value access.
|
| |
| const_reference | operator() (const int theIndex) const |
| | operator() - alias to Value
|
| |
| const_reference | operator[] (const int theIndex) const |
| | operator[] - alias to Value
|
| |
| reference | ChangeValue (const int theIndex) |
| | Variable value access.
|
| |
| reference | operator() (const int theIndex) |
| | operator() - alias to ChangeValue
|
| |
| reference | operator[] (const int theIndex) |
| | operator[] - alias to ChangeValue
|
| |
| const_reference | At (const size_t theIndex) const |
| | 0-based checked access independent of Lower()/Upper().
|
| |
| reference | ChangeAt (const size_t theIndex) |
| | 0-based checked mutable access independent of Lower()/Upper().
|
| |
| void | SetValue (const int theIndex, const value_type &theItem) |
| | Set value.
|
| |
| void | SetValue (const int theIndex, value_type &&theItem) |
| | Set value.
|
| |
| template<typename... Args> |
| reference | EmplaceValue (const int theIndex, Args &&... theArgs) |
| | Emplace value at the specified index, constructing it in-place.
|
| |
| void | UpdateLowerBound (const int theLower) noexcept |
| | Changes the lowest bound. Do not move data.
|
| |
| void | UpdateUpperBound (const int theUpper) noexcept |
| | Changes the upper bound. Do not move data.
|
| |
| void | Resize (const int theLower, const int theUpper, const bool theToCopyData) |
| | Resizes the array to specified bounds. No re-allocation will be done if length of array does not change, but existing values will not be discarded if theToCopyData set to FALSE.
|
| |
| void | Resize (const size_t theSize, const bool theToCopyData) |
| | Resizes the array to theSize elements, keeping the lower bound unchanged.
|
| |
| bool | IsDeletable () const noexcept |
| |
|
| void | resizeImpl (const size_t theNewSize, const int theNewLower, const bool theToCopyData) |
| | Core resize implementation used by all public Resize() overloads.
|
| |
| const_reference | at (const size_t theIndex) const |
| |
| reference | at (const size_t theIndex) |
| |
| template<typename U = TheItemType> |
| std::enable_if< std::is_trivially_default_constructible< U >::value, void >::type | construct (const size_t, const size_t) |
| |
| template<typename U = TheItemType> |
| std::enable_if<!std::is_trivially_default_constructible< U >::value, void >::type | construct (const size_t theFrom, const size_t theTo) |
| |
| template<typename U = TheItemType> |
| std::enable_if< std::is_trivially_destructible< U >::value, void >::type | destroy (pointer, const size_t, const size_t) |
| |
| template<typename U = TheItemType> |
| std::enable_if<!std::is_trivially_destructible< U >::value, void >::type | destroy (pointer theWhat, const size_t theFrom, const size_t theTo) |
| |
| void | assign (const const_pointer theFrom, const size_t theSize, const int theLower) |
| |
| template<typename U = TheItemType> |
| std::enable_if< std::is_trivially_copyable< U >::value, void >::type | copyAssign (pointer theTarget, const_pointer theFrom, const size_t theCount) |
| |
| template<typename U = TheItemType> |
| std::enable_if<!std::is_trivially_copyable< U >::value, void >::type | copyAssign (pointer theTarget, const_pointer theFrom, const size_t theCount) |
| |
| void | copyConstruct (const pointer theFrom, const size_t theCount) |
| |
| template<typename U = TheItemType> |
| std::enable_if< std::is_trivially_copyable< U >::value, void >::type | copyConstruct (pointer theTarget, const_pointer theFrom, const size_t theCount) |
| |
| template<typename U = TheItemType> |
| std::enable_if<!std::is_trivially_copyable< U >::value, void >::type | copyConstruct (pointer theTarget, const_pointer theFrom, const size_t theCount) |
| |
The class NCollection_Array1 represents unidimensional arrays of fixed size known at run time. The range of the index is user defined. An array1 can be constructed with a "C array". This functionality is useful to call methods expecting an Array1. It allows to carry the bounds inside the arrays.
Examples:
#define Item
Definition MAT_ListOfBisector.hxx:96
STL input iterator that wraps an OCCT More()/Next() iterator.
Definition NCollection_ForwardRange.hxx:142
If you want to reindex an array from 1 to Length do:
Warning: Programs client of such a class must be independent of the range of the first element. Then, a C++ for loop must be written like this
for (i = A.Lower(); i <= A.Upper(); i++)
Zero-based (size_t) construction mode: Use NCollection_Array1(size_t theSize) or NCollection_Array1(pointer, size_t) to create a zero-based array (Lower()==0). In this mode At()/ChangeAt() and STL iterators are the preferred access path - they address elements directly without any offset subtraction. Buffer-reuse variants do NOT own the memory and will not free it on destruction.
for (
size_t i = 0; i <
aWrap.Size(); ++i)
aWrap.At(i) =
static_cast<int>(i);