OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
libdap::NDimensionalArray Class Reference

#include <NDimensionalArray.h>

Collaboration diagram for libdap::NDimensionalArray:
Collaboration graph

Public Member Functions

long elementCount ()
 
libdap::Array * getArray (libdap::Array *templateArray)
 
unsigned int getCurrentLastDimensionHyperSlab ()
 
long getLastDimensionElementCount ()
 Returns the size, in elements, of the last dimension. More...
 
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 of the last dimension hyper-slab and the number of elements in the hyper-slab. More...
 
void getNextLastDimensionHyperSlab (void **slab)
 
void * getStorage ()
 
Type getTypeTemplate ()
 
 NDimensionalArray (libdap::Array *arrayTemplate)
 
 NDimensionalArray (std::vector< unsigned int > *shape, libdap::Type dapType)
 
void * relinquishStorage ()
 Returns a pointer to the underlying storage for the NDimensionalArray. More...
 
void resetSlabIndex ()
 
void setAll (char val)
 Uses 'memset' to set ALL of the values in the NDimensionalArray to the passed char value. More...
 
void setCurrentLastDimensionHyperSlab (unsigned int newIndex)
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_byte *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_int16 *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_uint16 *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_int32 *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_uint32 *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_float32 *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
void setLastDimensionHyperSlab (std::vector< unsigned int > *location, dods_float64 *values, unsigned int numVal)
 Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray). More...
 
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. More...
 
dods_int16 setValue (std::vector< unsigned int > *location, dods_int16 value)
 Sets the value of the array at the location specified by the passed location vector. More...
 
dods_uint16 setValue (std::vector< unsigned int > *location, dods_uint16 value)
 Sets the value of the array at the location specified by the passed location vector. More...
 
dods_int32 setValue (std::vector< unsigned int > *location, dods_int32 value)
 Sets the value of the array at the location specified by the passed location vector. More...
 
dods_uint32 setValue (std::vector< unsigned int > *location, dods_uint32 value)
 Sets the value of the array at the location specified by the passed location vector. More...
 
dods_float32 setValue (std::vector< unsigned int > *location, dods_float32 value)
 Sets the value of the array at the location specified by the passed location vector. More...
 
dods_float64 setValue (std::vector< unsigned int > *location, dods_float64 value)
 Sets the value of the array at the location specified by the passed location vector. More...
 
unsigned int sizeOfElement ()
 
string toString ()
 
virtual ~NDimensionalArray ()
 

Static Public Member Functions

static long computeArraySizeFromShapeVector (vector< unsigned int > *shape)
 Computes the total number of elements of the n-dimensional array described by the shape vector. More...
 
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::Array 'a'. More...
 
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 an n-dimensional array described by the shape vector. More...
 
static void retrieveLastDimHyperSlabLocationFromConstrainedArrray (libdap::Array *a, vector< unsigned int > *location)
 
static string vectorToIndices (vector< unsigned int > *v)
 

Detailed Description

Definition at line 43 of file NDimensionalArray.h.

Constructor & Destructor Documentation

libdap::NDimensionalArray::NDimensionalArray ( libdap::Array *  arrayTemplate)

Definition at line 63 of file NDimensionalArray.cc.

References BESDEBUG, computeConstrainedShape(), and vectorToIndices().

Here is the call graph for this function:

libdap::NDimensionalArray::NDimensionalArray ( std::vector< unsigned int > *  shape,
libdap::Type  dapType 
)

Definition at line 78 of file NDimensionalArray.cc.

References BESDEBUG, computeArraySizeFromShapeVector(), and vectorToIndices().

Here is the call graph for this function:

libdap::NDimensionalArray::~NDimensionalArray ( )
virtual

Definition at line 93 of file NDimensionalArray.cc.

Member Function Documentation

long libdap::NDimensionalArray::computeArraySizeFromShapeVector ( vector< unsigned int > *  shape)
static

Computes the total number of elements of the n-dimensional array described by the shape vector.

Definition at line 218 of file NDimensionalArray.cc.

Referenced by NDimensionalArray().

long libdap::NDimensionalArray::computeConstrainedShape ( libdap::Array *  a,
vector< unsigned int > *  shape 
)
static

Computes and returns (via the returned value parameter 'shape') the constrained shape of the libdap::Array 'a'.

Returns the total number of elements in constrained shape.

Definition at line 117 of file NDimensionalArray.cc.

References BESDEBUG.

Referenced by NDimensionalArray().

long libdap::NDimensionalArray::elementCount ( )
inline

Definition at line 85 of file NDimensionalArray.h.

libdap::Array * libdap::NDimensionalArray::getArray ( libdap::Array *  templateArray)

Definition at line 621 of file NDimensionalArray.cc.

References BESDEBUG.

unsigned int libdap::NDimensionalArray::getCurrentLastDimensionHyperSlab ( )
inline

Definition at line 101 of file NDimensionalArray.h.

long libdap::NDimensionalArray::getLastDimensionElementCount ( )

Returns the size, in elements, of the last dimension.

Definition at line 617 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::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 of the last dimension hyper-slab and the number of elements in the hyper-slab.

The passed the location vector, identifies the requested slab.The location vector must have N-1 elements where N is the number of dimensions in the NDimensionalArray.

Definition at line 430 of file NDimensionalArray.cc.

References BESDEBUG, getStorageIndex(), and vectorToIndices().

Here is the call graph for this function:

void libdap::NDimensionalArray::getNextLastDimensionHyperSlab ( void **  slab)

Definition at line 457 of file NDimensionalArray.cc.

References BESDEBUG.

void* libdap::NDimensionalArray::getStorage ( )
inline

Definition at line 90 of file NDimensionalArray.h.

long libdap::NDimensionalArray::getStorageIndex ( vector< unsigned int > *  shape,
vector< unsigned int > *  location 
)
static

Computes the element index in the underlying one dimensional array for the passed location based on an n-dimensional array described by the shape vector.

Definition at line 469 of file NDimensionalArray.cc.

References BESDEBUG.

Referenced by getLastDimensionHyperSlab(), and setValue().

Type libdap::NDimensionalArray::getTypeTemplate ( )
inline

Definition at line 96 of file NDimensionalArray.h.

void * libdap::NDimensionalArray::relinquishStorage ( )

Returns a pointer to the underlying storage for the NDimensionalArray.

Calling this function is effectively telling the instance of NDimensionalArray to 'release' it's reference to the storage. While the memory will not be deleted by this call, the instance of NDimensionalArray will remove it's internal reference to the storage and thus when the NDimensionalArray goes out of scope, or is otherwise deleted the storage WILL NOT BE DELETED. CALLING THIS METHOD MEANS THAT YOU ARE NOW RESPONSIBLE FOR FREEING THE MEMORY REFERENCED BY THE RETURNED POINTER.

Definition at line 105 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::resetSlabIndex ( )
inline

Definition at line 100 of file NDimensionalArray.h.

void libdap::NDimensionalArray::retrieveLastDimHyperSlabLocationFromConstrainedArrray ( libdap::Array *  a,
vector< unsigned int > *  location 
)
static

Definition at line 152 of file NDimensionalArray.cc.

References BESDEBUG, and vectorToIndices().

Here is the call graph for this function:

void libdap::NDimensionalArray::setAll ( char  val)

Uses 'memset' to set ALL of the values in the NDimensionalArray to the passed char value.

Definition at line 608 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setCurrentLastDimensionHyperSlab ( unsigned int  newIndex)
inline

Definition at line 102 of file NDimensionalArray.h.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_byte *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 512 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_int16 *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 524 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_uint16 *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 536 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_int32 *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 548 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_uint32 *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 560 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_float32 *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 572 of file NDimensionalArray.cc.

void libdap::NDimensionalArray::setLastDimensionHyperSlab ( std::vector< unsigned int > *  location,
dods_float64 *  values,
unsigned int  valueCount 
)

Sets all of the values in the last dimension hyper-hyper slab identified by the N-1 element location vector (where N is the number of dimensions in the NDimensionalArray).

The number of values passed in must match the size of the last dimension hyper-slab, and the type of the values must match the underlying type of the NDimensionalArray.

Definition at line 583 of file NDimensionalArray.cc.

dods_byte libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_byte  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 315 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

dods_int16 libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_int16  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 332 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

dods_uint16 libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_uint16  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 349 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

dods_int32 libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_int32  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 365 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

dods_uint32 libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_uint32  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 381 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

dods_float32 libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_float32  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 397 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

dods_float64 libdap::NDimensionalArray::setValue ( std::vector< unsigned int > *  location,
dods_float64  value 
)

Sets the value of the array at the location specified by the passed location vector.

The number of elements in the location vector must be the the same as the number of dimensions in the NDimensionalArray and the type of the passed value must match the underlying type of the NDimensionalArray

Definition at line 413 of file NDimensionalArray.cc.

References getStorageIndex().

Here is the call graph for this function:

unsigned int libdap::NDimensionalArray::sizeOfElement ( )
inline

Definition at line 86 of file NDimensionalArray.h.

string libdap::NDimensionalArray::toString ( )

Definition at line 801 of file NDimensionalArray.cc.

string libdap::NDimensionalArray::vectorToIndices ( vector< unsigned int > *  v)
static

The documentation for this class was generated from the following files: