halapi
hierarchichalalignmentformatapi
|
#include <rawH5ExternalArray.h>
Public Member Functions | |
RawH5ExternalArray () | |
virtual | ~RawH5ExternalArray () |
void | create (H5::H5File *file, const H5std_string &path, const H5::DataType &dataType, hsize_t numElements, const H5::DSetCreatPropList &cparms=H5::DSetCreatPropList::DEFAULT) |
void | load (H5::H5File *file, const H5std_string &path, hsize_t chunksInBuffer=1) |
void | write () |
const void * | get (hsize_t i) |
void * | getUpdate (hsize_t i) |
Protected Member Functions | |
void | page (hsize_t i) |
Protected Attributes | |
H5::H5File * | _file |
H5std_string | _path |
H5::DataType | _dataType |
H5::DataSpace | _dataSpace |
H5::DataSet | _dataSet |
hsize_t | _size |
hsize_t | _chunkSize |
hsize_t | _dataSize |
hsize_t | _bufStart |
hsize_t | _bufEnd |
hsize_t | _bufSize |
char * | _buf |
H5::DataSpace | _chunkSpace |
bool | _dirty |
Wrapper for a 1-dimensional HDF5 array of fixed length. Array objects are defined (and typed) by the input datatype. The array is paged into memory chunk-by-chunk as needed (using the HDF5 cache as a back-end). We can't use compiler tpying of the input objects (and instead just expose the raw void* data) because the elements' sizes are not known at compile time, and we don't want to move it around once its read.
RawH5ExternalArray::RawH5ExternalArray | ( | ) |
Constructor
RawH5ExternalArray::~RawH5ExternalArray | ( | ) | [virtual] |
Destructor
void RawH5ExternalArray::create | ( | H5::H5File * | file, |
const H5std_string & | path, | ||
const H5::DataType & | dataType, | ||
hsize_t | numElements, | ||
const H5::DSetCreatPropList & | cparms = H5::DSetCreatPropList::DEFAULT |
||
) |
Create a new dataset in specifed location
file | HDF5 file in which to add new array dataset |
path | location of new daset in file |
dataType | HDF5 Datatype describing contents of array |
numElements | Fixed length of the new array |
cparams | Creation parameters for new dataset (chunking, zipping) |
const void * hal::RawH5ExternalArray::get | ( | hsize_t | i | ) | [inline] |
Access the raw data at given index
i | index of element to retrieve for reading |
void * hal::RawH5ExternalArray::getUpdate | ( | hsize_t | i | ) | [inline] |
Write the raw data at given index
i | index of element to retrieve for updating |
void RawH5ExternalArray::load | ( | H5::H5File * | file, |
const H5std_string & | path, | ||
hsize_t | chunksInBuffer = 1 |
||
) |
Load an existing dataset into memory
file | HDF5 file from which to retrieve the array |
path | location of array in file |
chunksInBuffer | override dataset's native chunking. 0: load entire array into buffer 1: use default chunking (from dataset) N: buffersize will be N chunks. |
void RawH5ExternalArray::page | ( | hsize_t | i | ) | [protected] |
Read chunk from file
void RawH5ExternalArray::write | ( | ) |
Write the memory buffer back to the file
char* hal::RawH5ExternalArray::_buf [protected] |
In-memory buffer
hsize_t hal::RawH5ExternalArray::_bufEnd [protected] |
Index of last element in memory buffer
hsize_t hal::RawH5ExternalArray::_bufSize [protected] |
Number of elements in memory buffer
hsize_t hal::RawH5ExternalArray::_bufStart [protected] |
Index of first element in memory buffer
hsize_t hal::RawH5ExternalArray::_chunkSize [protected] |
Size of chunk in elements
H5::DataSpace hal::RawH5ExternalArray::_chunkSpace [protected] |
Dimensional information for in-memory buffer
H5::DataSet hal::RawH5ExternalArray::_dataSet [protected] |
The HDF5 array object
hsize_t hal::RawH5ExternalArray::_dataSize [protected] |
Size of datatype in bytes
H5::DataSpace hal::RawH5ExternalArray::_dataSpace [protected] |
Dataspace (dimension information) of array
H5::DataType hal::RawH5ExternalArray::_dataType [protected] |
Datatype for array
bool hal::RawH5ExternalArray::_dirty [protected] |
Flag saying we should write to disk on write or page-out calls (set by getUpdate())
H5::H5File* hal::RawH5ExternalArray::_file [protected] |
Pointer to file that owns this dataset
H5std_string hal::RawH5ExternalArray::_path [protected] |
Path of dataset in file
hsize_t hal::RawH5ExternalArray::_size [protected] |
Number of elements in the array (fixed length)