Go to the documentation of this file.
7 #ifndef INCLUDE_JET_ARRAY_ACCESSOR1_H_
8 #define INCLUDE_JET_ARRAY_ACCESSOR1_H_
42 void reset(
size_t size, T*
const data);
48 const T&
at(
size_t i)
const;
87 template <
typename Callback>
106 template <
typename Callback>
130 template <
typename Callback>
151 template <
typename Callback>
183 template <
typename T>
199 const T&
at(
size_t i)
const;
205 const T*
const end()
const;
229 template <
typename Callback>
248 template <
typename Callback>
269 template <
typename Callback>
285 #include "detail/array_accessor1-inl.h"
287 #endif // INCLUDE_JET_ARRAY_ACCESSOR1_H_
ConstArrayAccessor(const ArrayAccessor< T, 1 > &other)
Constructs a read-only array accessor from read/write accessor.
ArrayAccessor & operator=(const ArrayAccessor &other)
Copies given array accessor other.
T * end()
Returns the end iterator of the array.
1-D read-only array accessor class.
Definition: array_accessor1.h:184
ArrayAccessor(const ArrayAccessor &other)
Copy constructor.
void forEachIndex(Callback func) const
Iterates the array and invoke given func for each index.
const T & at(size_t i) const
Returns the const reference to the i-th element.
T *const data() const
Returns the raw pointer to the array data.
const T & operator[](size_t i) const
Returns the const reference to i-th element.
void reset(size_t size, T *const data)
Resets the array.
ArrayAccessor()
Constructs empty 1-D array accessor.
T *const end() const
Returns the end iterator of the array.
void parallelForEachIndex(Callback func) const
Iterates the array and invoke given func for each index in parallel using multi-threading.
void parallelForEachIndex(Callback func) const
Iterates the array and invoke given func for each index in parallel using multi-threading.
const T & operator[](size_t i) const
Returns the const reference to i-th element.
ConstArrayAccessor(const ConstArrayAccessor &other)
Copy constructor.
Definition: advection_solver2.h:18
size_t size() const
Returns size of the array.
const T & at(size_t i) const
Returns the const reference to the i-th element.
ConstArrayAccessor()
Constructs empty 1-D array accessor.
Generic N-dimensional read-only array accessor class interface.
Definition: array_accessor.h:47
T & at(size_t i)
Returns the reference to the i-th element.
void forEach(Callback func) const
Iterates the array and invoke given func for each element.
size_t size() const
Returns size of the array.
void swap(ArrayAccessor &other)
Swaps the content of with other array accessor.
ArrayAccessor(size_t size, T *const data)
Constructs an array accessor that wraps given array.
const T *const data() const
Returns the raw pointer to the array data.
void set(const ArrayAccessor &other)
Replaces the content with given other array accessor.
void parallelForEach(Callback func)
Iterates the array and invoke given func for each element in parallel using multi-threading.
void forEachIndex(Callback func) const
Iterates the array and invoke given func for each index.
const T *const begin() const
Returns the begin iterator of the array.
void forEach(Callback func) const
Iterates the array and invoke given func for each element.
const T *const end() const
Returns the end iterator of the array.
T *const begin() const
Returns the begin iterator of the array.
T & operator[](size_t i)
Returns the reference to i-th element.
1-D array accessor class.
Definition: array_accessor1.h:27
Generic N-dimensional array accessor class interface.
Definition: array_accessor.h:29
T * begin()
Returns the begin iterator of the array.
ConstArrayAccessor(size_t size, const T *const data)
Constructs an read-only array accessor that wraps given array.