Inherits IMXAArray.
Inherited by MXA2DArray< T >.
Inheritance diagram for MXAArrayTemplate< T >:
Public Member Functions | |
virtual | ~MXAArrayTemplate () |
Destructor. | |
virtual void | takeOwnership () |
Makes this class responsible for freeing the memory. | |
virtual void | releaseOwnership () |
This class will NOT free the memory associated with the internal pointer. This can be useful if the user wishes to keep the data around after this class goes out of scope. | |
virtual void | initialize () |
Initializes this class to zero bytes freeing any data that it currently owns. | |
virtual void | initializeWithZeros () |
Sets all the values to zero. | |
virtual int32 | resize (uint64 size) |
Reseizes the internal array. | |
virtual void * | getVoidPointer (uint64 i) |
Returns a void pointer pointing to the index of the array. NULL pointers are entirely possible. No checks are performed to make sure the index is with in the range of the internal data array. | |
virtual T | getValue (uint64 i) |
Returns the value for a given index. | |
virtual uint64 | getNumberOfElements () |
Returns the number of elements in the internal array. | |
virtual void | getDimensions (uint64 *dims) |
Copies the values of the dimensions into the supplied pointer. | |
virtual int32 | getNumberOfDimensions () |
void | setValue (uint64 i, T value) |
Sets a specific value in the array. | |
virtual int32 | getDataType () |
Returns an enumerated type that can be used to find out the type of primitive stored in the internal array. Currently the HDF5 type is returned in order to use this class effectively with HDF5. | |
virtual size_t | getTypeSize () |
Returns the number of bytes that make up the data type. 1 = char 2 = 16 bit integer 4 = 32 bit integer/Float 8 = 64 bit integer/Double. | |
virtual void | byteSwapElements () |
Byte swaps the Elements in the array. Needed if you want to convert the endianess of the data. | |
virtual T * | getPointer (uint64 i) |
Returns the pointer to a specific index into the array. No checks are made as to the correctness of the index being passed in. If you ask for an index off then end of the array they you will likely cause your program to abort. | |
virtual int32 | exportToFile (DataExportProperties::Pointer expProps) |
Saves the array to an external file on the system. | |
int32 | _binaryExport (DataExportProperties::Pointer expProps) |
int32 | _asciiExport (DataExportProperties::Pointer expProps) |
virtual void | printSelf (std::ostream &os, int32 indent) |
Prints information about the class to ostream. | |
virtual std::string | valueToString (char delimiter= ' ') |
Converts the data array into a string delimited by the supplied delimiter. | |
Static Public Member Functions | |
static IMXAArray::Pointer | CreateArray (uint64 numElements) |
Static constructor. | |
static IMXAArray::Pointer | CreateMultiDimensionalArray (size_t nDims, const uint64 *dims) |
Creates an IMXAArray::Pointer object for the supplied arguments. | |
static IMXAArray::Pointer | CreateSingleValueArray (T value) |
Creates an Attribute from a single value. | |
static MXAArrayTemplate< T > * | New (uint64 numElements) |
Static construction of MXAArrayTemplate objects. YOU are responsible for cleaning up the memory that this method creates. | |
static MXAArrayTemplate< T > * | New (size_t nDims, const uint64 *dims) |
Creates a MultiDimensional Array allocating the memory immediately. | |
Protected Member Functions | |
MXAArrayTemplate (int32 numElements, bool ownsData=true) | |
Protected Constructor. | |
MXAArrayTemplate (size_t numDims, const uint64 *dims, bool ownsData=true) | |
Constructor used to create an MXAArrayTemplate class that has multiple dimensions. | |
int32 | _allocate () |
Allocates the memory needed for this class. | |
virtual T * | _resizeAndExtend (uint64 size) |
resizes the internal array to be 'size' elements in length | |
Private Member Functions | |
MXAArrayTemplate (const MXAArrayTemplate &) | |
void | operator= (const MXAArrayTemplate &) |
Private Attributes | |
T * | _data |
uint64 | _nElements |
bool | _ownsData |
std::vector< uint64 > | _dims |
virtual MXAArrayTemplate< T >::~MXAArrayTemplate | ( | ) | [inline, virtual] |
Destructor.
MXAArrayTemplate< T >::MXAArrayTemplate | ( | int32 | numElements, | |
bool | ownsData = true | |||
) | [inline, protected] |
Protected Constructor.
numElements | The number of elements in the internal array. | |
takeOwnership | Will the class clean up the memory. Default=true |
MXAArrayTemplate< T >::MXAArrayTemplate | ( | size_t | numDims, | |
const uint64 * | dims, | |||
bool | ownsData = true | |||
) | [inline, protected] |
Constructor used to create an MXAArrayTemplate class that has multiple dimensions.
numDims | The number of dimensions to the data set. | |
dims | The actual values of the dimensions. | |
takeOwnership | Will the class clean up the memory. Default=true |
MXAArrayTemplate< T >::MXAArrayTemplate | ( | const MXAArrayTemplate< T > & | ) | [private] |
static IMXAArray::Pointer MXAArrayTemplate< T >::CreateArray | ( | uint64 | numElements | ) | [inline, static] |
Static constructor.
numElements | The number of elements in the internal array. |
static IMXAArray::Pointer MXAArrayTemplate< T >::CreateMultiDimensionalArray | ( | size_t | nDims, | |
const uint64 * | dims | |||
) | [inline, static] |
Creates an IMXAArray::Pointer object for the supplied arguments.
nDims | Number of dimensions | |
dims | Size of each dimension |
static IMXAArray::Pointer MXAArrayTemplate< T >::CreateSingleValueArray | ( | T | value | ) | [inline, static] |
Creates an Attribute from a single value.
value | The value to store in the attribute |
static MXAArrayTemplate<T>* MXAArrayTemplate< T >::New | ( | uint64 | numElements | ) | [inline, static] |
Static construction of MXAArrayTemplate objects. YOU are responsible for cleaning up the memory that this method creates.
numElements | The number of elements in the internal array. |
static MXAArrayTemplate<T>* MXAArrayTemplate< T >::New | ( | size_t | nDims, | |
const uint64 * | dims | |||
) | [inline, static] |
Creates a MultiDimensional Array allocating the memory immediately.
nDims | The number of dimensions | |
dims | The size of each dimension |
virtual void MXAArrayTemplate< T >::takeOwnership | ( | ) | [inline, virtual] |
virtual void MXAArrayTemplate< T >::releaseOwnership | ( | ) | [inline, virtual] |
virtual void MXAArrayTemplate< T >::initialize | ( | ) | [inline, virtual] |
Initializes this class to zero bytes freeing any data that it currently owns.
Reimplemented in MXA2DArray< T >.
virtual void MXAArrayTemplate< T >::initializeWithZeros | ( | ) | [inline, virtual] |
virtual int32 MXAArrayTemplate< T >::resize | ( | uint64 | size | ) | [inline, virtual] |
Reseizes the internal array.
size | The new size of the internal array |
Reimplemented in MXA2DArray< T >, and MXARGBImage.
virtual void* MXAArrayTemplate< T >::getVoidPointer | ( | uint64 | i | ) | [inline, virtual] |
Returns a void pointer pointing to the index of the array. NULL pointers are entirely possible. No checks are performed to make sure the index is with in the range of the internal data array.
i | The index to have the returned pointer pointing to. |
Implements IMXAArray.
virtual T MXAArrayTemplate< T >::getValue | ( | uint64 | i | ) | [inline, virtual] |
Returns the value for a given index.
i | The index to return the value at |
virtual uint64 MXAArrayTemplate< T >::getNumberOfElements | ( | ) | [inline, virtual] |
virtual void MXAArrayTemplate< T >::getDimensions | ( | uint64 * | dims | ) | [inline, virtual] |
Copies the values of the dimensions into the supplied pointer.
dims | Pointer to store the dimension values into |
Implements IMXAArray.
Reimplemented in MXA2DArray< T >, and MXARGBImage.
virtual int32 MXAArrayTemplate< T >::getNumberOfDimensions | ( | ) | [inline, virtual] |
Returns the number of dimensions the data has.
Implements IMXAArray.
Reimplemented in MXA2DArray< T >, and MXARGBImage.
void MXAArrayTemplate< T >::setValue | ( | uint64 | i, | |
T | value | |||
) | [inline] |
Sets a specific value in the array.
i | The index of the value to set | |
value | The new value to be set at the specified index |
virtual int32 MXAArrayTemplate< T >::getDataType | ( | ) | [inline, virtual] |
Returns an enumerated type that can be used to find out the type of primitive stored in the internal array. Currently the HDF5 type is returned in order to use this class effectively with HDF5.
Implements IMXAArray.
Reimplemented in MXAAsciiStringData.
virtual size_t MXAArrayTemplate< T >::getTypeSize | ( | ) | [inline, virtual] |
Returns the number of bytes that make up the data type. 1 = char 2 = 16 bit integer 4 = 32 bit integer/Float 8 = 64 bit integer/Double.
Implements IMXAArray.
virtual void MXAArrayTemplate< T >::byteSwapElements | ( | ) | [inline, virtual] |
Byte swaps the Elements in the array. Needed if you want to convert the endianess of the data.
Implements IMXAArray.
virtual T* MXAArrayTemplate< T >::getPointer | ( | uint64 | i | ) | [inline, virtual] |
Returns the pointer to a specific index into the array. No checks are made as to the correctness of the index being passed in. If you ask for an index off then end of the array they you will likely cause your program to abort.
i | The index to return the pointer to. |
virtual int32 MXAArrayTemplate< T >::exportToFile | ( | DataExportProperties::Pointer | expProps | ) | [inline, virtual] |
Saves the array to an external file on the system.
expProps | The properties to use when saving the array |
Implements IMXAArray.
int32 MXAArrayTemplate< T >::_binaryExport | ( | DataExportProperties::Pointer | expProps | ) | [inline] |
int32 MXAArrayTemplate< T >::_asciiExport | ( | DataExportProperties::Pointer | expProps | ) | [inline] |
virtual void MXAArrayTemplate< T >::printSelf | ( | std::ostream & | os, | |
int32 | indent | |||
) | [inline, virtual] |
virtual std::string MXAArrayTemplate< T >::valueToString | ( | char | delimiter = ' ' |
) | [inline, virtual] |
Converts the data array into a string delimited by the supplied delimiter.
delimiter | The delimiter to use between each value. Default is a single space |
Implements IMXAArray.
Reimplemented in MXA2DArray< T >, MXAAsciiStringData, and MXARGBImage.
int32 MXAArrayTemplate< T >::_allocate | ( | ) | [inline, protected] |
Allocates the memory needed for this class.
virtual T* MXAArrayTemplate< T >::_resizeAndExtend | ( | uint64 | size | ) | [inline, protected, virtual] |
resizes the internal array to be 'size' elements in length
size |
void MXAArrayTemplate< T >::operator= | ( | const MXAArrayTemplate< T > & | ) | [private] |
T* MXAArrayTemplate< T >::_data [private] |
uint64 MXAArrayTemplate< T >::_nElements [private] |
bool MXAArrayTemplate< T >::_ownsData [private] |
std::vector<uint64> MXAArrayTemplate< T >::_dims [private] |