NDArray Class Reference

N-dimensional array class; each array has a set of dimensions, a data type, pointer to data, and optional attributes. More...

#include <NDArray.h>

List of all members.

Public Member Functions

 NDArray ()
 NDArray constructor, no parameters.
 ~NDArray ()
 NDArray destructor Frees the data array, deletes all attributes, frees the attribute list and destroys the mutex.
int initDimension (NDDimension_t *pDimension, int size)
 Initializes the dimension structure to size=size, binning=1, reverse=0, offset=0.
int getInfo (NDArrayInfo_t *pInfo)
 Convenience method returns information about an NDArray, including the total number of elements, the number of bytes per element, and the total number of bytes in the array.
int reserve ()
 Calls NDArrayPool::reserve() for this NDArray object; increases the reference count for this array.
int release ()
 Calls NDArrayPool::release() for this object; decreases the reference count for this array.
int report (int details)
 Reports on the properties of the array.

Public Attributes

class NDArrayPoolpNDArrayPool
 The NDArrayPool object that created this array.
int uniqueId
 A number that must be unique for all NDArrays produced by a driver after is has started.
double timeStamp
 The time stamp in seconds for this array; seconds since Epoch (00:00:00 UTC, January 1, 1970) is recommended, but some drivers may use a different start time.
int ndims
 The number of dimensions in this array; minimum=1.
NDDimension_t dims [ND_ARRAY_MAX_DIMS]
 Array of dimension sizes for this array; first ndims values are meaningful.
NDDataType_t dataType
 Data type for this array.
int dataSize
 Data size for this array; actual amount of memory allocated for *pData, may be more than required to hold the array.
void * pData
 Pointer to the array data.
NDAttributeListpAttributeList
 Linked list of attributes.

Friends

class NDArrayPool


Detailed Description

N-dimensional array class; each array has a set of dimensions, a data type, pointer to data, and optional attributes.

An NDArray also has a uniqueId and timeStamp that to identify it. NDArray objects can be allocated by an NDArrayPool object, which maintains a free list of NDArrays for efficient memory management.


Constructor & Destructor Documentation

NDArray::NDArray (  ) 

NDArray constructor, no parameters.

Initializes all fields to 0. Creates the attribute linked list and linked list mutex.

NDArray::~NDArray (  ) 

NDArray destructor Frees the data array, deletes all attributes, frees the attribute list and destroys the mutex.


Member Function Documentation

int NDArray::getInfo ( NDArrayInfo_t pInfo  ) 

Convenience method returns information about an NDArray, including the total number of elements, the number of bytes per element, and the total number of bytes in the array.

Parameters:
[out] pInfo Pointer to an NDArrayInfo_t structure, must have been allocated by caller.

int NDArray::initDimension ( NDDimension_t pDimension,
int  size 
)

Initializes the dimension structure to size=size, binning=1, reverse=0, offset=0.

Parameters:
[in] pDimension Pointer to an NDDimension_t structure, must have been allocated by caller.
[in] size The size of this dimension.

int NDArray::release (  ) 

Calls NDArrayPool::release() for this object; decreases the reference count for this array.

int NDArray::report ( int  details  ) 

Reports on the properties of the array.

Parameters:
[in] details Level of report details desired; if >5 calls NDAttributeList::report().

int NDArray::reserve (  ) 

Calls NDArrayPool::reserve() for this NDArray object; increases the reference count for this array.


Friends And Related Function Documentation

friend class NDArrayPool [friend]


Member Data Documentation

Data size for this array; actual amount of memory allocated for *pData, may be more than required to hold the array.

Data type for this array.

NDDimension_t NDArray::dims[ND_ARRAY_MAX_DIMS]

Array of dimension sizes for this array; first ndims values are meaningful.

The number of dimensions in this array; minimum=1.

Linked list of attributes.

Pointer to the array data.

The data is assumed to be stored in the order of dims[0] changing fastest, and dims[ndims-1] changing slowest.

The NDArrayPool object that created this array.

The time stamp in seconds for this array; seconds since Epoch (00:00:00 UTC, January 1, 1970) is recommended, but some drivers may use a different start time.

A number that must be unique for all NDArrays produced by a driver after is has started.


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

Generated on Tue Aug 9 14:44:38 2011 for areaDetector by  doxygen 1.5.7.1