25#ifndef NDIMENSIONALARRAY_H_
26#define NDIMENSIONALARRAY_H_
28#include <libdap/Array.h>
32static string NDimensionalArray_debug_key =
"ugrid";
42 libdap::Type _dapType;
44 std::vector<unsigned int> *_shape;
45 unsigned int _currentLastDimensionSlabIndex;
47 long _totalValueCount;
48 unsigned int _sizeOfValue;
51 void allocateStorage(
long numValues, libdap::Type dapType);
52 void confirmStorage();
53 void confirmType(
Type dapType);
54 void confirmLastDimSize(
unsigned int n);
55 void setLastDimensionHyperSlab(std::vector<unsigned int> *location,
void *values,
unsigned int byteCount);
57 string toString_worker(vector<unsigned int> *index);
66 dods_byte
setValue(std::vector<unsigned int> *location, dods_byte value);
67 dods_int16
setValue(std::vector<unsigned int> *location, dods_int16 value);
68 dods_uint16
setValue(std::vector<unsigned int> *location, dods_uint16 value);
69 dods_int32
setValue(std::vector<unsigned int> *location, dods_int32 value);
70 dods_uint32
setValue(std::vector<unsigned int> *location, dods_uint32 value);
71 dods_float32
setValue(std::vector<unsigned int> *location, dods_float32 value);
72 dods_float64
setValue(std::vector<unsigned int> *location, dods_float64 value);
74 static void retrieveLastDimHyperSlabLocationFromConstrainedArrray(libdap::Array *a, vector<unsigned int> *location);
77 static long getStorageIndex(vector<unsigned int> *shape, vector<unsigned int> *location);
81 return _totalValueCount;
83 unsigned int sizeOfElement()
98 Type getTypeTemplate()
104 void getNextLastDimensionHyperSlab(
void **slab);
105 void resetSlabIndex()
107 _currentLastDimensionSlabIndex = 0;
109 unsigned int getCurrentLastDimensionHyperSlab()
111 return _currentLastDimensionSlabIndex;
113 void setCurrentLastDimensionHyperSlab(
unsigned int newIndex)
115 _currentLastDimensionSlabIndex = newIndex;
118 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_byte *values,
unsigned int numVal);
119 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_int16 *values,
unsigned int numVal);
120 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_uint16 *values,
unsigned int numVal);
121 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_int32 *values,
unsigned int numVal);
122 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_uint32 *values,
unsigned int numVal);
123 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_float32 *values,
unsigned int numVal);
124 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_float64 *values,
unsigned int numVal);
126 libdap::Array *getArray(libdap::Array *templateArray);
129 static string vectorToIndices(vector<unsigned int> *v);
void getLastDimensionHyperSlab(std::vector< unsigned int > *location, void **slab, unsigned int *elementCount)
static long getStorageIndex(vector< unsigned int > *shape, vector< unsigned int > *location)
void * relinquishStorage()
static long computeConstrainedShape(libdap::Array *a, vector< unsigned int > *shape)
long getLastDimensionElementCount()
static long computeArraySizeFromShapeVector(vector< unsigned int > *shape)
dods_byte setValue(std::vector< unsigned int > *location, dods_byte value)