My Project
|
Provide read-only and read/write access to constantly sized portions/windows of a linearised buffer with an implied 1D array structure. More...
#include <WindowedArray.hpp>
Classes | |
struct | NumWindows |
Distinct compile-time type for number of windows in underlying storage. More... | |
struct | WindowSize |
Distinct compile-time type for size of windows (number of data items per window.) More... | |
Public Member Functions | |
WindowedArray (const NumWindows n, const WindowSize sz) | |
Constructor. | |
WindowedArray (const WindowedArray &rhs)=default | |
WindowedArray (WindowedArray &&rhs)=default | |
WindowedArray & | operator= (const WindowedArray &rhs)=delete |
WindowedArray & | operator= (WindowedArray &&rhs)=default |
Idx | numWindows () const |
Retrieve number of windows allocated for this array. | |
Idx | windowSize () const |
Retrieve number of data items per windows. | |
WriteWindow | operator[] (const Idx window) |
Request read/write access to individual window. | |
ReadWindow | operator[] (const Idx window) const |
Request read-only access to individual window. | |
const std::vector< T > & | data () const |
Get read-only access to full, linearised data items for all windows. | |
std::vector< T > | getDataDestructively () |
Extract full, linearised data items for all windows. | |
Provide read-only and read/write access to constantly sized portions/windows of a linearised buffer with an implied 1D array structure.
Intended as backing store for vectors that have a constant number of items per entity (e.g., N integer data items for each active group at a report step).
T | Element type for underlying data items. |
|
inlineexplicit |
Constructor.
[in] | n | Number of windows. |
[in] | sz | Number of data items per window. |
|
inline |
Extract full, linearised data items for all windows.
Destroys the internal state of the WindowedArray
.
|
inline |
Request read/write access to individual window.
[in] | window | Numeric ID of particular read/write window. Must be in range [0 .. numWindows()-1]
Idx numWindows() const Retrieve number of windows allocated for this array. Definition WindowedArray.hpp:88 |
|
inline |
Request read-only access to individual window.
[in] | window | Numeric ID of particular read-only window. Must be in range [0 .. numWindows()-1]
|