SPH
|
Object providing safe access to continuous memory of data. More...
#include <ArrayView.h>
Public Types | |
using | Type = T |
using | Counter = TCounter |
Public Member Functions | |
INLINE | ArrayView () |
INLINE | ArrayView (StorageType *data, TCounter size) |
INLINE | ArrayView (const ArrayView &other) |
INLINE | ArrayView (std::nullptr_t) |
Explicitly initialize to nullptr. More... | |
INLINE ArrayView & | operator= (const ArrayView &other) |
Copy operator. More... | |
INLINE | operator ArrayView< const T, TCounter > () const |
Implicit conversion to const version. More... | |
INLINE Iterator< StorageType > | begin () |
INLINE Iterator< const StorageType > | begin () const |
INLINE Iterator< StorageType > | end () |
INLINE Iterator< const StorageType > | end () const |
INLINE T & | operator[] (const TCounter idx) |
INLINE const T & | operator[] (const TCounter idx) const |
INLINE T & | front () |
INLINE const T & | front () const |
INLINE T & | back () |
INLINE const T & | back () const |
INLINE TCounter | size () const |
INLINE bool | empty () const |
INLINE ArrayView | subset (const TCounter start, const TCounter length) const |
Returns a subset of the arrayview. More... | |
INLINE bool | operator! () const |
INLINE | operator bool () const |
bool | operator== (const ArrayView &other) const |
Comparison operator, comparing arrayviews element-by-element. More... | |
bool | operator!= (const ArrayView &other) const |
Inequality operator. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const ArrayView &array) |
Prints content of arrayview to stream. More... | |
Object providing safe access to continuous memory of data.
Useful to write generic code that can be used with any kind of storage where the data are stored consecutively in memory. Commonly used containers are implicitly convertible to ArrayView.
Definition at line 17 of file ArrayView.h.
Definition at line 26 of file ArrayView.h.
Definition at line 25 of file ArrayView.h.
|
inline |
Definition at line 28 of file ArrayView.h.
|
inline |
Definition at line 31 of file ArrayView.h.
|
inline |
Definition at line 35 of file ArrayView.h.
|
inline |
Explicitly initialize to nullptr.
Definition at line 40 of file ArrayView.h.
Definition at line 91 of file ArrayView.h.
|
inline |
Definition at line 96 of file ArrayView.h.
|
inline |
Definition at line 55 of file ArrayView.h.
|
inline |
Definition at line 59 of file ArrayView.h.
|
inline |
Definition at line 105 of file ArrayView.h.
|
inline |
Definition at line 63 of file ArrayView.h.
|
inline |
Definition at line 67 of file ArrayView.h.
|
inline |
Definition at line 81 of file ArrayView.h.
|
inline |
Definition at line 86 of file ArrayView.h.
|
inline |
Implicit conversion to const version.
Definition at line 51 of file ArrayView.h.
|
inlineexplicit |
Definition at line 119 of file ArrayView.h.
|
inline |
Definition at line 115 of file ArrayView.h.
|
inline |
Inequality operator.
Definition at line 137 of file ArrayView.h.
|
inline |
Copy operator.
Definition at line 44 of file ArrayView.h.
|
inline |
Comparison operator, comparing arrayviews element-by-element.
Definition at line 124 of file ArrayView.h.
|
inline |
Definition at line 71 of file ArrayView.h.
|
inline |
Definition at line 76 of file ArrayView.h.
|
inline |
Definition at line 101 of file ArrayView.h.
|
inline |
Returns a subset of the arrayview.
Definition at line 110 of file ArrayView.h.
|
friend |
Prints content of arrayview to stream.
Stored values must have overloaded << operator.
Definition at line 144 of file ArrayView.h.