25 #ifndef NDIMENSIONALARRAY_H_
26 #define NDIMENSIONALARRAY_H_
34 static string NDimensionalArray_debug_key =
"ugrid";
46 std::vector<unsigned int> *_shape;
47 unsigned int _currentLastDimensionSlabIndex;
49 long _totalValueCount;
50 unsigned int _sizeOfValue;
53 void allocateStorage(
long numValues,
libdap::Type dapType);
54 void confirmStorage();
55 void confirmType(
Type dapType);
56 void confirmLastDimSize(
unsigned int n);
57 void setLastDimensionHyperSlab(std::vector<unsigned int> *location,
void *values,
unsigned int byteCount);
59 string toString_worker(vector<unsigned int> *index);
68 dods_byte
setValue(std::vector<unsigned int> *location, dods_byte value);
69 dods_int16
setValue(std::vector<unsigned int> *location, dods_int16 value);
70 dods_uint16
setValue(std::vector<unsigned int> *location, dods_uint16 value);
71 dods_int32
setValue(std::vector<unsigned int> *location, dods_int32 value);
72 dods_uint32
setValue(std::vector<unsigned int> *location, dods_uint32 value);
73 dods_float32
setValue(std::vector<unsigned int> *location, dods_float32 value);
74 dods_float64
setValue(std::vector<unsigned int> *location, dods_float64 value);
76 static void retrieveLastDimHyperSlabLocationFromConstrainedArrray(libdap::Array *a, vector<unsigned int> *location);
79 static long getStorageIndex(vector<unsigned int> *shape, vector<unsigned int> *location);
83 return _totalValueCount;
85 unsigned int sizeOfElement()
100 Type getTypeTemplate()
106 void getNextLastDimensionHyperSlab(
void **slab);
107 void resetSlabIndex()
109 _currentLastDimensionSlabIndex = 0;
111 unsigned int getCurrentLastDimensionHyperSlab()
113 return _currentLastDimensionSlabIndex;
115 void setCurrentLastDimensionHyperSlab(
unsigned int newIndex)
117 _currentLastDimensionSlabIndex = newIndex;
120 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_byte *values,
unsigned int numVal);
121 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_int16 *values,
unsigned int numVal);
122 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_uint16 *values,
unsigned int numVal);
123 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_int32 *values,
unsigned int numVal);
124 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_uint32 *values,
unsigned int numVal);
125 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_float32 *values,
unsigned int numVal);
126 void setLastDimensionHyperSlab(std::vector<unsigned int> *location, dods_float64 *values,
unsigned int numVal);
128 libdap::Array *getArray(libdap::Array *templateArray);
131 static string vectorToIndices(vector<unsigned int> *v);