template<int MAJOR_ORDER_TYPE>
class WmTypeOpaqueArray< MAJOR_ORDER_TYPE >
Defines common interface for arrays of elements.
Support for arbitrary dimensions, major ordering, and start indices.
|
| WmTypeOpaqueArray (const WxRange &range, void *data, int numBytesPerElement) |
| Array spanning given range object.
|
|
| WmTypeOpaqueArray (const WmTypeOpaqueArray< MAJOR_ORDER_TYPE > &that) |
| Copy constructor does not allocate new memory.
|
|
WmTypeOpaqueArray< MAJOR_ORDER_TYPE > & | operator= (const WmTypeOpaqueArray< MAJOR_ORDER_TYPE > &that) |
|
void * | data () |
| Access start of raw array data.
|
|
const void * | data () const |
| Access start of raw array data.
|
|
void * | data (const int *indices) |
| Access raw array element.
|
|
const void * | data (const int *indices) const |
| Access raw array element.
|
|
void * | dataSlab (const int *indices, int indicesRank) |
| Access higher dimension slab of raw array element.
|
|
const void * | dataSlab (const int *indices, int indicesRank) const |
| Access higher dimension slab of raw array element.
|
|
int | numBytesPerElement () const |
|
void | put (const WxRange &selection, const WxRange &inputShape, const void *bufin) |
| Copy data elements from bufin to the region described by the range selection.
|
|
void | get (const WxRange &selection, const WxRange &outputShape, void *bufout) const |
| Copy data elements from the region described range selection to the bufout provided.
|
|
virtual | ~WmTypeOpaqueArray () |
| Delete object which only describes the array geometry, no array allocation is deleted.
|
|
const WxRange & | range () const |
|
template<int MAJOR_ORDER_TYPE>
Delete object which only describes the array geometry, no array allocation is deleted.
Protected because I anticipate programmer error if ever trying to call delete on a pointer to a WmTypedArrray and for potential performance reasons, I did not want to just make the destructor virtual and forget about it.
For unstructured meshes these arrays are important for defining patch data within a global array Making this public means I can pass around typed arrays without worrying about data type
template<int MAJOR_ORDER_TYPE>
Copy data elements from the region described range selection to the bufout provided.
Destination buffer elements are assumed to be arranged according to outputShape such that the first element in bufout corresponds to the upper-left corner of outputShape. In other words, the absolute values of outputShape are ignored, only the side length matters.
NOTE: if selection has lower rank than this range, the selection range is extruded to match this range's higher-dimensional shape.
Behavior is undefined if inputShape is smaller than selection.
- Parameters
-
selection | hyper-rectangular range in this array to copy from. |
outputShape | shape range representing the in array extents. Must be equal or larger than selection |
bufout | desitination data elements with contiguous arrangement. |
template<int MAJOR_ORDER_TYPE>
Copy data elements from bufin to the region described by the range selection.
Assumes that the bufin elements are arranged exactly matching the dimensions of the destination range. (i.e. same major ordering, no ghost/exterior cells skipping.
NOTE: if selection has lower rank than this range, the selection range is extruded to match this range's higher-dimensional shape.
- Parameters
-
hyper-rectangular | range in this array to copy into. |
source | data elements with contiguous arrangement. Copy data elements from the region described range selection to the bufout provided. |
The bufout elements are arranged exactly matching the dimensions of the source range. (i.e. same major ordering, no ghost/exterior cell skipping.
NOTE: if selection has lower rank than this range, the selection range is extruded to match this range's higher-dimensional shape.
- Parameters
-
hyper-rectangular | range in this array to copy from. |
desitination | data elements with contiguous arrangement. Copy data elements from bufin to the region described by the range selection. |
Source buffer elements are assumed to be arranged according to inputShape such that the first element in bufin corresponds to the upper-left corner of inputShape. In other words, the absolute values of inputShape are ignored, only the side length matters. Behavior is undefined if inputShape is smaller than selection.
NOTE: if selection has lower rank than this range, the selection range is extruded to match this range's higher-dimensional shape.
- Parameters
-
selection | hyper-rectangular range in this array to copy into. |
inputShape | shape range representing the desired output array extent. Must be equal or larger than selection |
bufin | source data elements with contiguous arrangement. |