|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Wrapper around common array operations which holds: More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/mint/utils/ArrayWrapper.hpp>

Public Member Functions | |
| ArrayWrapper ()=default | |
| Default-constructs an empty ArrayWrapper. More... | |
| template<typename ArrayT > | |
| ArrayWrapper & | operator= (ArrayT &&arr) |
| Assigns the underlying variant with a specific array. More... | |
| void | push_back (const T &value) |
| Pushes a value to the back of the wrapped array. More... | |
| void | insert (IndexType pos, IndexType n, const T *values) |
| Inserts elements into the wrapped array at a position. More... | |
| void | insert (IndexType index, ArrayView< const T, DIM > span) |
| Inserts elements from a view into the wrapped array. More... | |
| void | append (ArrayView< const T, DIM > span) |
| Appends elements from a view to the wrapped array. More... | |
| void | set (const T *elements, IndexType n, IndexType pos) |
| Sets a range of elements in the wrapped array. More... | |
| template<typename... Args> | |
| void | resize (Args... args) |
| Resizes the wrapped array. More... | |
| void | reserve (IndexType newCapacity) |
| Reserves capacity in the wrapped array. More... | |
| void | shrink () |
| Shrinks the wrapped array's capacity to its size. More... | |
| void | setResizeRatio (double ratio) |
| Sets the resize ratio of the wrapped array. More... | |
| double | getResizeRatio () const |
| Returns the resize ratio used by the wrapped array. More... | |
| IndexType | size () const |
| Returns the number of elements in the wrapped array. More... | |
| IndexType | capacity () const |
| Returns the capacity of the wrapped array. More... | |
| bool | empty () const |
| Returns true if the wrapped array contains no elements. More... | |
| T * | data () |
| Returns a pointer to the wrapped array's data buffer. More... | |
| const T * | data () const |
| Returns a const pointer to the wrapped array's data buffer. More... | |
| T * | operator* () |
| Returns a pointer to the wrapped data buffer. More... | |
| const T * | operator* () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| axom::StackArray< IndexType, DIM > | shape () const |
| Returns the logical shape of the wrapped array. More... | |
| const ArrayVariant & | getVariant () const |
| Returns the underlying variant object storing the wrapped arrays. More... | |
Wrapper around common array operations which holds:
|
default |
Default-constructs an empty ArrayWrapper.
|
inline |
Assigns the underlying variant with a specific array.
|
inline |
Pushes a value to the back of the wrapped array.
| [in] | value | The value to append. |
|
inline |
Inserts elements into the wrapped array at a position.
| [in] | pos | The position at which to begin insertion. |
| [in] | n | The number of elements to insert. |
| [in] | values | Pointer to the elements to insert; must reference at least n values. |
|
inline |
Inserts elements from a view into the wrapped array.
Inserts the contents of span at the given index of the wrapped array.
| [in] | index | The position at which to begin insertion. |
| [in] | span | View containing the elements to insert. |
|
inline |
Appends elements from a view to the wrapped array.
Elements in span are appended at the end of the wrapped array.
| [in] | span | View containing the elements to append. |
|
inline |
Sets a range of elements in the wrapped array.
Copies n elements from elements into the wrapped array starting at position pos.
| [in] | elements | Pointer to the source elements. |
| [in] | n | Number of elements to copy. |
| [in] | pos | Starting position in the wrapped array. |
|
inline |
Resizes the wrapped array.
Forwards the given size arguments to the underlying array's resize method.
| [in] | args | New extents for each dimension. |
|
inline |
Reserves capacity in the wrapped array.
Ensures that the wrapped array can hold at least newCapacity elements without reallocation.
| [in] | newCapacity | The new capacity in number of elements. |
|
inline |
Shrinks the wrapped array's capacity to its size.
|
inline |
Sets the resize ratio of the wrapped array.
Controls the factor by which capacity grows when the wrapped array is reallocated.
| [in] | ratio | New resize ratio. |
|
inline |
Returns the resize ratio used by the wrapped array.
|
inline |
Returns the number of elements in the wrapped array.
|
inline |
Returns the capacity of the wrapped array.
|
inline |
Returns true if the wrapped array contains no elements.
|
inline |
Returns a pointer to the wrapped array's data buffer.
|
inline |
Returns a const pointer to the wrapped array's data buffer.
|
inline |
Returns a pointer to the wrapped data buffer.
Equivalent to calling data().
References axom::mint::detail::ArrayWrapper< T, DIM >::data().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References axom::mint::detail::ArrayWrapper< T, DIM >::data().
|
inline |
Returns the logical shape of the wrapped array.
|
inline |
Returns the underlying variant object storing the wrapped arrays.