Public Types | |
enum | CustomHDFDataTypes { MXA_GROUP = 1, MXA_DATASET = 2, MXA_TYPE = 4, MXA_LINK = 8, MXA_ANY = 15 } |
Public Member Functions | |
virtual | ~H5Utilities () |
Static Public Member Functions | |
static MXA_EXPORT hid_t | openFile (const std::string &filename, bool readOnly=false) |
static MXA_EXPORT hid_t | createFile (const std::string &filename) |
static MXA_EXPORT herr_t | closeFile (hid_t &fileId) |
static MXA_EXPORT std::string | getObjectPath (hid_t objId, bool trim=false) |
Retuirns the path to an object. | |
static MXA_EXPORT herr_t | getObjectType (hid_t objId, const std::string &objName, int32 *objType) |
Returns the hdf object type. | |
static MXA_EXPORT herr_t | objectNameAtIndex (hid_t fileId, int32 idx, std::string &name) |
Retrieves the object name for a given index. | |
static MXA_EXPORT bool | isGroup (hid_t objId, const std::string &objName) |
Returns if a given hdf5 object is a group. | |
static MXA_EXPORT hid_t | openHDF5Object (hid_t locId, const std::string &objectPath) |
Opens an HDF5 object for hdf5 operations. | |
static MXA_EXPORT herr_t | closeHDF5Object (hid_t locId) |
Closes the object id. | |
static MXA_EXPORT std::string | HDFClassTypeAsStr (hid_t class_type) |
static MXA_EXPORT void | printHDFClassType (H5T_class_t classT) |
prints the class type of the given class | |
static MXA_EXPORT herr_t | getGroupObjects (hid_t loc_id, int32 typeFilter, std::list< std::string > &names) |
Returns a list of child hdf5 objects for a given object id. | |
static MXA_EXPORT hid_t | createGroup (hid_t loc_id, const std::string &group) |
Creates a HDF Group by checking if the group already exists. If the group already exists then that group is returned otherwise a new group is created. | |
static MXA_EXPORT herr_t | createGroupsFromPath (const std::string &pathToCheck, hid_t parent) |
Given a path relative to the Parent ID, this method will create all the intermediate groups if necessary. | |
static MXA_EXPORT herr_t | createGroupsForDataset (const std::string &datasetPath, hid_t parent) |
Given a path relative to the Parent ID, this method will create all the intermediate groups if necessary. | |
static MXA_EXPORT std::string | extractObjectName (const std::string &path) |
Extracts the object name from a given path. | |
static MXA_EXPORT bool | probeForAttribute (hid_t loc_id, const std::string &obj_name, const std::string &attr_name) |
Looks for an attribute with a given name. | |
static MXA_EXPORT herr_t | getAllAttributeNames (hid_t objId, std::list< std::string > &names) |
Returns a list of all the attribute names. | |
static MXA_EXPORT herr_t | getAllAttributeNames (hid_t objId, const std::string &obj_name, std::list< std::string > &names) |
Returns a list of all the attribute names. | |
static MXA_EXPORT herr_t | readAllAttributes (hid_t fileId, const std::string &datasetPath, MXAAbstractAttributes &attributes) |
Returns a vector of IAttributes, one for each attribute of a given hdf5 object. | |
template<typename T> | |
static IMXAArray::Pointer | readH5Data (hid_t locId, const std::string &datasetPath, const std::vector< uint64 > &dims) |
Reads data into an IMXAArray::Pointer. | |
template<typename T> | |
static IMXAArray::Pointer | readH5Attribute (hid_t locId, const std::string &datasetPath, const std::string &key, const std::vector< uint64 > &dims) |
Reads data from an Attribute into an IAttributePtr. | |
Protected Member Functions | |
H5Utilities () | |
Private Member Functions | |
H5Utilities (const H5Utilities &) | |
void | operator= (const H5Utilities &) |
virtual H5Utilities::~H5Utilities | ( | ) | [virtual] |
H5Utilities::H5Utilities | ( | ) | [inline, protected] |
H5Utilities::H5Utilities | ( | const H5Utilities & | ) | [private] |
hid_t H5Utilities::openFile | ( | const std::string & | filename, | |
bool | readOnly = false | |||
) | [static] |
hid_t H5Utilities::createFile | ( | const std::string & | filename | ) | [static] |
herr_t H5Utilities::closeFile | ( | hid_t & | fileId | ) | [static] |
std::string H5Utilities::getObjectPath | ( | hid_t | objId, | |
bool | trim = false | |||
) | [static] |
Retuirns the path to an object.
objId | The HDF5 id of the object | |
trim | set to False to trim the path |
herr_t H5Utilities::getObjectType | ( | hid_t | objId, | |
const std::string & | objName, | |||
int32 * | objType | |||
) | [static] |
Returns the hdf object type.
objId | The hdf5 object id | |
objName | The path to the data set | |
objType | The type of the object |
herr_t H5Utilities::objectNameAtIndex | ( | hid_t | fileId, | |
int32 | idx, | |||
std::string & | name | |||
) | [static] |
Retrieves the object name for a given index.
fileId | The hdf5 object id | |
idx | The index to retrieve the name for | |
name | The variable to store the name |
bool H5Utilities::isGroup | ( | hid_t | objId, | |
const std::string & | objName | |||
) | [static] |
Returns if a given hdf5 object is a group.
objId | The hdf5 object that contains an object with name objName | |
objName | The name of the object to check |
hid_t H5Utilities::openHDF5Object | ( | hid_t | locId, | |
const std::string & | objectPath | |||
) | [static] |
Opens an HDF5 object for hdf5 operations.
locId | the Object id of the parent | |
objectPath | The path of the object to open |
herr_t H5Utilities::closeHDF5Object | ( | hid_t | locId | ) | [static] |
Closes the object id.
locId | The object id to close |
std::string H5Utilities::HDFClassTypeAsStr | ( | hid_t | class_type | ) | [static] |
void H5Utilities::printHDFClassType | ( | H5T_class_t | classT | ) | [static] |
prints the class type of the given class
classT | The Class Type to print |
herr_t H5Utilities::getGroupObjects | ( | hid_t | loc_id, | |
int32 | typeFilter, | |||
std::list< std::string > & | names | |||
) | [static] |
Returns a list of child hdf5 objects for a given object id.
loc_id | The parent hdf5 id | |
typeFilter | A filter to apply to the list | |
names | Variable to store the list |
hid_t H5Utilities::createGroup | ( | hid_t | loc_id, | |
const std::string & | group | |||
) | [static] |
Creates a HDF Group by checking if the group already exists. If the group already exists then that group is returned otherwise a new group is created.
loc_id | The HDF unique id given to files or groups | |
group | The name of the group to create. Note that this group name should not be any sort of 'path'. It should be a single group. |
int32 H5Utilities::createGroupsFromPath | ( | const std::string & | pathToCheck, | |
hid_t | parent | |||
) | [static] |
Given a path relative to the Parent ID, this method will create all the intermediate groups if necessary.
pathToCheck | The path to either create or ensure exists. | |
parent | The HDF unique id for the parent |
int32 H5Utilities::createGroupsForDataset | ( | const std::string & | datasetPath, | |
hid_t | parent | |||
) | [static] |
Given a path relative to the Parent ID, this method will create all the intermediate groups if necessary.
datasetPath | The path to the dataset that you want to make all the intermediate groups for | |
parent | The HDF unique id for the parent |
std::string H5Utilities::extractObjectName | ( | const std::string & | path | ) | [static] |
Extracts the object name from a given path.
path | The path which to extract the object name |
bool H5Utilities::probeForAttribute | ( | hid_t | loc_id, | |
const std::string & | obj_name, | |||
const std::string & | attr_name | |||
) | [static] |
Looks for an attribute with a given name.
loc_id | The objects Parent id | |
obj_name | The name of the object | |
attr_name | The attribute to look for (by name) |
herr_t H5Utilities::getAllAttributeNames | ( | hid_t | objId, | |
std::list< std::string > & | names | |||
) | [static] |
Returns a list of all the attribute names.
objId | The parent object | |
names | Variable to hold the list of attribute names |
herr_t H5Utilities::getAllAttributeNames | ( | hid_t | objId, | |
const std::string & | obj_name, | |||
std::list< std::string > & | names | |||
) | [static] |
Returns a list of all the attribute names.
objId | The parent object | |
obj_name | The name of the object whose attribute names you want a list | |
names | Variable to hold the list of attribute names |
herr_t H5Utilities::readAllAttributes | ( | hid_t | fileId, | |
const std::string & | datasetPath, | |||
MXAAbstractAttributes & | attributes | |||
) | [static] |
Returns a vector of IAttributes, one for each attribute of a given hdf5 object.
fileId | The parent hdf5 id | |
datasetPath | The path to the hdf5 object whose attributes you want | |
attributes | Variable to store the attributes |
static IMXAArray::Pointer H5Utilities::readH5Data | ( | hid_t | locId, | |
const std::string & | datasetPath, | |||
const std::vector< uint64 > & | dims | |||
) | [inline, static] |
Reads data into an IMXAArray::Pointer.
locId | The hdf5 object id of the parent | |
datasetPath | The path to the data set containing the attributes you want | |
dims | The dimensions of the attribute |
static IMXAArray::Pointer H5Utilities::readH5Attribute | ( | hid_t | locId, | |
const std::string & | datasetPath, | |||
const std::string & | key, | |||
const std::vector< uint64 > & | dims | |||
) | [inline, static] |
Reads data from an Attribute into an IAttributePtr.
locId | The hdf5 object id of the parent | |
datasetPath | The path to the data set containing the attributes you want | |
key | The name of the attribute to read | |
dims | The dimensions of the attribute |
void H5Utilities::operator= | ( | const H5Utilities & | ) | [private] |