27 #ifndef NDIMENSIONALARRAY_H_
28 #define NDIMENSIONALARRAY_H_
38 static string NDimensionalArray_debug_key =
"ugrid";
48 libdap::Type _dapType;
50 std::vector<unsigned int> *_shape;
51 unsigned int _currentLastDimensionSlabIndex;
53 long _totalValueCount;
54 unsigned int _sizeOfValue;
57 void allocateStorage(
long numValues, libdap::Type dapType);
58 void confirmStorage();
59 void confirmType(Type dapType);
60 void confirmLastDimSize(
unsigned int n);
61 void setLastDimensionHyperSlab(std::vector<unsigned int> *location,
void *values,
unsigned int byteCount);
63 string toString_worker(vector<unsigned int> *index);
72 dods_byte
setValue(std::vector<unsigned int> *location, dods_byte value);
73 dods_int16
setValue(std::vector<unsigned int> *location, dods_int16 value);
74 dods_uint16
setValue(std::vector<unsigned int> *location, dods_uint16 value);
75 dods_int32
setValue(std::vector<unsigned int> *location, dods_int32 value);
76 dods_uint32
setValue(std::vector<unsigned int> *location, dods_uint32 value);
77 dods_float32
setValue(std::vector<unsigned int> *location, dods_float32 value);
78 dods_float64
setValue(std::vector<unsigned int> *location, dods_float64 value);
83 static long getStorageIndex(vector<unsigned int> *shape, vector<unsigned int> *location);
104 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_byte *values,
unsigned int numVal);
105 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_int16 *values,
unsigned int numVal);
106 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_uint16 *values,
unsigned int numVal);
107 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_int32 *values,
unsigned int numVal);
108 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_uint32 *values,
unsigned int numVal);
109 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_float32 *values,
unsigned int numVal);
110 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_float64 *values,
unsigned int numVal);
112 libdap::Array *
getArray(libdap::Array *templateArray);
unsigned int sizeOfElement()
libdap::Array * getArray(libdap::Array *templateArray)
unsigned int getCurrentLastDimensionHyperSlab()
void * relinquishStorage()
Returns a pointer to the underlying storage for the NDimensionalArray.
static long computeArraySizeFromShapeVector(vector< unsigned int > *shape)
Computes the total number of elements of the n-dimensional array described by the shape vector...
static class NCMLUtil overview
static void retrieveLastDimHyperSlabLocationFromConstrainedArrray(libdap::Array *a, vector< unsigned int > *location)
long getLastDimensionElementCount()
Returns the size, in elements, of the last dimension.
void setAll(char val)
Uses 'memset' to set ALL of the values in the NDimensionalArray to the passed char value...
static long getStorageIndex(vector< unsigned int > *shape, vector< unsigned int > *location)
Computes the element index in the underlying one dimensional array for the passed location based on a...
static string vectorToIndices(vector< unsigned int > *v)
static long computeConstrainedShape(libdap::Array *a, vector< unsigned int > *shape)
Computes and returns (via the returned value parameter 'shape') the constrained shape of the libdap::...
void getNextLastDimensionHyperSlab(void **slab)
dods_byte setValue(std::vector< unsigned int > *location, dods_byte value)
Sets the value of the array at the location specified by the passed location vector.
void setCurrentLastDimensionHyperSlab(unsigned int newIndex)
void getLastDimensionHyperSlab(std::vector< unsigned int > *location, void **slab, unsigned int *elementCount)
The return value parameters slab and elementCount are used to return a pointer to the first element o...
virtual ~NDimensionalArray()