Represent a mutable view to a multi-dimensional storage. More...
#include <StorageView.h>
Public Member Functions | |
| void | setSlice (Slice slice) |
Set the slice of the StorageView | |
| Slice & | getSlice () noexcept |
Get the slice of the StorageView | |
| const Slice & | getSlice () const noexcept |
| bool | isMemCopyable () const noexcept |
| Return true if the storage is contiguous in memory (i.e no padding) and is column-major ordered. | |
| std::size_t | size () const noexcept |
| Size of the allocated, sliced data (without padding) | |
| std::size_t | sizeInBytes () const noexcept |
| Size of the allocated, sliced data (without padding) in Bytes. | |
Constructors | |
| StorageView (void *originPtr, TypeID type, const std::vector< int > &dims, const std::vector< int > &strides) | |
| Construct StorageView. | |
| StorageView (void *originPtr, TypeID type, std::vector< int > &&dims, std::vector< int > &&strides) | |
| Construct StorageView (move version) | |
| StorageView (const StorageView &other)=default | |
| Copy constructor. | |
| StorageView (StorageView &&other)=default | |
| Move constructor. | |
Iterator | |
| StorageViewIterator | begin () noexcept |
| Iterator to the beginning of the data. | |
| ConstStorageViewIterator | begin () const noexcept |
| StorageViewIterator | end () noexcept |
| Iterator to the end of the data. | |
| ConstStorageViewIterator | end () const noexcept |
Getter | |
| template<class T > | |
| T * | originPtrAs () noexcept |
Get data pointer as type T of the origin of the data. | |
| template<class T > | |
| const T * | originPtrAs () const noexcept |
| Byte * | originPtr () noexcept |
| Get raw data pointer. | |
| const Byte * | originPtr () const noexcept |
| TypeID | type () const noexcept |
| Get type. | |
| int | bytesPerElement () const noexcept |
| Get bytes per element. | |
| const std::vector< int > & | dims () const noexcept |
| Get dimensions. | |
| const std::vector< int > & | strides () const noexcept |
| Get strides. | |
Operators | |
| StorageView & | operator= (const StorageView &other)=default |
| Copy assignment. | |
| StorageView & | operator= (StorageView &&other)=default |
| Move assignment. | |
| void | swap (StorageView &other) noexcept |
| Swap with other. | |
| bool | operator== (const StorageView &right) const noexcept |
| Test for equality. | |
| bool | operator!= (const StorageView &right) const noexcept |
| Test for inequality. | |
| std::ostream & | operator<< (std::ostream &stream, const StorageView &s) |
| Convert to stream. | |
Represent a mutable view to a multi-dimensional storage.
Definition at line 33 of file StorageView.h.