Templated C++ class to access array data
The templated TypedArray
class provides type-safe APIs to handle all
MATLAB array types (except sparse arrays). To create a TypedArray
, call
createArray
or createScalar
in the
ArrayFactory
class with one of the templates listed in Template Instantiations.
This class defines the following iterator types:
using iterator = TypedIterator<T>; using const_iterator = TypedIterator<T const>;
Namespace: | matlab::data |
Base class: | matlab::data::Array |
Include: | TypedArray.hpp |
|
Type of element referred to. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
matlab::data::Array |
matlab::data::Struct |
matlab::data::Enumeration |
TypedArray(const TypedArray<T>& rhs)
TypedArray(const Array& rhs)
Creates a shared data copy of the input.
|
Value to be copied. |
|
Value specified as |
|
Type of input |
TypedArray<T>& operator=(const TypedArray<T>&
rhs)
TypedArray<T>& operator=(const Array&
rhs)
Assigns a shared data copy of the input to this
TypedArray<T>
.
|
Value to be copied. |
|
Value specified as |
|
Updated instance. |
|
Type of input |
TypedArray(TypedArray<T>&& rhs)
TypedArray(Array&& rhs)
Moves contents of the input to a new instance.
|
Value to be moved. |
|
Value specified as |
|
Type of input does not match. |
TypedArray<T>& operator=(TypedArray<T>&&
rhs)
TypedArray<T>& operator=(Array&&
rhs)
Moves the input to this TypedArray<T>
object.
|
Value to move. |
|
Updated instance. |
|
Type of input |
virtual ~TypedArray()
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
|
Iterator to beginning of array, specified as
|
|
Iterator, specified as |
None
iterator end()
const_iterator end() const
const_iterator cend() const
|
Iterator to end of array, specified as
|
|
Iterator, specified as |
None
operator[]
ArrayElementTypedRef<T, std::is_const<T>::value> operator[](size_t idx)
ArrayElementTypedRef<T, true> operator[](size_t idx) const
Enables []
indexing on a TypedArray
.
Indexing is 0-based.
|
First array index. |
|
Temporary object containing index specified. If type
|
|
Temporary object containing index specified. The return value allows the element of the array to be retrieved, but not modified. |
None
release
buffer_ptr_t<T> release()
Release the underlying buffer from the Array. If the Array is shared, a copy of the buffer is made; otherwise, no copy is made. After the buffer is released, the array contains no elements.
|
|
|
|