libpniio
|
![]() |
Modules | |
HDF5 implementation error classes | |
Data Structures | |
class | pni::io::nx::h5::attribute_imp |
attribute implementation More... | |
class | pni::io::nx::h5::field_factory |
factory for field construction More... | |
class | pni::io::nx::h5::field_imp |
dataset object More... | |
class | pni::io::nx::h5::file_imp |
HDF5 file implementation. More... | |
class | pni::io::nx::h5::group_imp |
HDF5 group object. More... | |
class | pni::io::nx::h5::h5dataspace |
dataspace object More... | |
class | pni::io::nx::h5::h5datatype |
HDF5 type wrapper. More... | |
class | pni::io::nx::h5::h5deflate_filter |
HDF5 deflate filter. More... | |
class | pni::io::nx::h5::h5filter |
base class for filter implementations More... | |
class | pni::io::nx::h5::h5link |
class | pni::io::nx::h5::object_imp |
basic HDF5 ID wrapper More... | |
class | pni::io::nx::h5::selection |
describe a selection in an HDF5 file More... | |
class | pni::io::nx::h5::selection_guard< STYPE > |
selection guard More... | |
struct | pni::io::nx::h5::type_imp |
provide implementation specific types More... | |
Typedefs | |
typedef std::vector< char * > | pni::io::nx::h5::char_ptr_vector_type |
vector tyep for char pointers More... | |
typedef std::vector< const char * > | pni::io::nx::h5::char_const_ptr_vector_type |
vector type for const char pointers More... | |
Functions | |
bool | pni::io::nx::h5::has_attribute (const object_imp &parent, const pni::core::string &name) |
checks for an attributes existence More... | |
void | pni::io::nx::h5::delete_attribute (const object_imp &parent, const pni::core::string &name) |
Deletes an attribute. More... | |
object_imp | pni::io::nx::h5::create_attribute (const object_imp &parent, const pni::core::string &name, const h5datatype &type, const h5dataspace &space, bool overwrite) |
create a new attribute at parent More... | |
object_imp | pni::io::nx::h5::get_attribute_by_name (const object_imp &parent, const pni::core::string &n) |
open attribute by name More... | |
size_t | pni::io::nx::h5::get_number_of_attributes (const object_imp &parent) |
get number of attributes More... | |
object_imp | pni::io::nx::h5::get_attribute_by_index (const object_imp &parent, size_t i) |
open attribute by index More... | |
std::ostream & | pni::io::nx::h5::operator<< (std::ostream &o, const h5dataspace &s) |
output operator More... | |
bool | pni::io::nx::h5::operator== (const h5datatype &a, const h5datatype &b) |
equality comparison More... | |
bool | pni::io::nx::h5::operator!= (const h5datatype &a, const h5datatype &b) |
inequality More... | |
pni::core::type_id_t | pni::io::nx::h5::type_id (const h5datatype &o) |
get type code More... | |
const h5datatype & | pni::io::nx::h5::get_type (pni::core::type_id_t id) |
get reference to type More... | |
h5datatype | pni::io::nx::h5::make_type (pni::core::type_id_t id) |
create new type More... | |
h5object_type | pni::io::nx::h5::get_hdf5_type (const object_imp &o) |
return HDF5 type More... | |
pni::io::nx::nxobject_type | pni::io::nx::h5::get_nexus_type (const object_imp &o) |
return Nexus type More... | |
pni::core::string | pni::io::nx::h5::get_filename (const object_imp &object) |
get object filename More... | |
pni::core::string | pni::io::nx::h5::get_path (const object_imp &object) |
get object path More... | |
pni::core::string | pni::io::nx::h5::get_name (const object_imp &obj) |
return object name More... | |
pni::core::string | pni::io::nx::h5::get_parent_path (const object_imp &object) |
get parent path More... | |
object_imp | pni::io::nx::h5::get_parent (const object_imp &obj) |
return the parent object More... | |
bool | pni::io::nx::h5::operator== (const object_imp &a, const object_imp &b) |
equality operator More... | |
bool | pni::io::nx::h5::operator!= (const object_imp &a, const object_imp &b) |
inequality operator More... | |
size_t | pni::io::nx::h5::effective_rank (const selection &s) noexcept |
get effective rank More... | |
type_imp::index_vector_type | pni::io::nx::h5::effective_shape (const selection &s) |
get effective shape More... | |
size_t | pni::io::nx::h5::size (const selection &s) noexcept |
get selection size More... | |
selection | pni::io::nx::h5::create_selection (const type_imp::selection_vector_type &s) |
type_imp::selection_vector_type | pni::io::nx::h5::create_slice_vector (const selection &s) |
bool | pni::io::nx::h5::is_vl_string (const h5datatype &type) |
check variable length string More... | |
bool | pni::io::nx::h5::is_static_string (const h5datatype &type) |
check if static length string More... | |
size_t | pni::io::nx::h5::static_string_size (const h5datatype &type) |
get static string size More... | |
void | pni::io::nx::h5::copy_from_vector (const char_vector_type &vector, size_t nstrs, size_t strsize, pni::core::string *strings, const formatter_ptr &formatter) |
copy char vector to strings More... | |
void | pni::io::nx::h5::copy_from_vector (const char_ptr_vector_type &vector, size_t nstrs, pni::core::string *strings, const formatter_ptr &formatter) |
copy strings from vector to a pointer of strings More... | |
HDF5 implementation of the Nexus file format. This module describes the implementation classes which are used to instantiate the low level class templates.
typedef std::vector<const char*> pni::io::nx::h5::char_const_ptr_vector_type |
This type is mainly used for writing strings of variable length to a field or attribute
typedef std::vector<char*> pni::io::nx::h5::char_ptr_vector_type |
Mainly used for reading strings of variable length from a field or attribute.
|
strong |
This enumeration class defines type-codes for different kinds of HDF5 objects. As all HDF5 objects are derived from H5Object an thus can be convereted into such an object we need this codes to identify the particular object type of an instance of H5Object.
void pni::io::nx::h5::copy_from_vector | ( | const char_vector_type & | vector, |
size_t | nstrs, | ||
size_t | strsize, | ||
pni::core::string * | strings, | ||
const formatter_ptr & | formatter | ||
) |
Copies the content of char vector to a set of strings. An exception is throws if the total number of required characters does not match the size of the vector.
size_mismatch_error | if nstrs*strsize!=vector.size() |
vector | the vector with characters |
nstrs | number of strings |
strsize | size of the strings |
strings | pointer to the first string instance |
void pni::io::nx::h5::copy_from_vector | ( | const char_ptr_vector_type & | vector, |
size_t | nstrs, | ||
pni::core::string * | strings, | ||
const formatter_ptr & | formatter | ||
) |
Copies the content of a pointer of stringsa
size_mismatch_error | if number of strings and vector size do not match |
vector | the vector with char poitners |
nstrs | number of strings |
strings | pointer to the first string |
object_imp pni::io::nx::h5::create_attribute | ( | const object_imp & | parent, |
const pni::core::string & | name, | ||
const h5datatype & | type, | ||
const h5dataspace & | space, | ||
bool | overwrite | ||
) |
Create a new attribute attached to a parent.
invalid_objet_error | if the parent object is not valid |
object_error | in case of any errors |
parent | the parent object for the attribute |
name | the name for the attribute |
type | an HDF5 data type |
space | the dataspace for the attribute |
overwrite | if true overwrite an existing attribute |
selection pni::io::nx::h5::create_selection | ( | const type_imp::selection_vector_type & | s | ) |
Create a selection from a slice vector.
s | reference to the slice vector |
type_imp::selection_vector_type pni::io::nx::h5::create_slice_vector | ( | const selection & | s | ) |
Create a slice vector from a selection. Such a slice vector might be used to create an array selection from an mdarray instance.
s | reference to the selection object |
void pni::io::nx::h5::delete_attribute | ( | const object_imp & | parent, |
const pni::core::string & | name | ||
) |
Deletes an attribute from the object.
invalid_object_error | if the object is not a valid HDF5 object |
object_error | in case of all other errors |
key_error | if attribute does not exist |
parent | reference to the parent object |
name | the name of the attribute to delete |
|
noexcept |
The effective rank for a selection is the number of dimension for whome the count value is >1.
s | selection instance |
type_imp::index_vector_type pni::io::nx::h5::effective_shape | ( | const selection & | s | ) |
The effective shape of a selection is basically the count buffer with those entries removed where its value is 1.
s | selection instance |
object_imp pni::io::nx::h5::get_attribute_by_index | ( | const object_imp & | parent, |
size_t | i | ||
) |
Opens an attribute reference by index i. If i exceeds the number of attributes attached to this object an exception will be thrown.
invalid_object_error | if parent object is not valid |
index_error | if i exceeds the total number of attributes attached to the parent object |
object_error | in case of any other error |
parent | the parent object from which to retrieve the attribute |
i | index of the attribute |
object_imp pni::io::nx::h5::get_attribute_by_name | ( | const object_imp & | parent, |
const pni::core::string & | n | ||
) |
Open an existing attribute and returns it to the callee. If the object does not exist key_error is thrown. In case of any other error oject_error;
invalid_object_error | if the parent object is not valid |
key_error | if attribute does not exist |
object_error | in case of other errors |
parent | reference to the parent object of the attribute |
n | name of the attribute |
string pni::io::nx::h5::get_filename | ( | const object_imp & | object | ) |
Returns the name of the file an HDF5 object belongs too. This function works with the following objects
invalid_object_error | if the object is not valid |
io_error | if object data cannot be retrieveda |
object_error | if validity check fails for some other reason |
type_error | if the passed object is of inappropriate type |
object | HDF5 object |
h5object_type pni::io::nx::h5::get_hdf5_type | ( | const object_imp & | o | ) |
Returns the HDF5 type of an instance of h5object. Currently this can be
An exception is thrown in case of an unknown type.
type_error | in case of an unkown object type |
invalid_object_error | if the object is not valid |
object_error | in case of any other error |
o | reference to h5object |
string pni::io::nx::h5::get_name | ( | const object_imp & | obj | ) |
Returns the name of an object. This function works for the following HDF5 types
object_error | if validity check fails |
invalid_object_error | if obj is not valid |
io_error | in case of data retrieval issues |
type_error | if object type cannot be determined |
obj | reference to the object from which to retrieve the name |
pni::nx::nexus_type pni::io::nx::h5::get_nexus_type | ( | const object_imp & | o | ) |
Return the Nexus type of an instance of h5object. This can be either a
An exception is thrown if the type is unkown.
type_error | in the case of an unkown object type |
invalid_object_error | if the object is not valid |
object_error | in case of any other error |
o | reference to h5object instance |
size_t pni::io::nx::h5::get_number_of_attributes | ( | const object_imp & | parent | ) |
Method returns the number of attributes attached to this object.
invalid_object_error | if the parent is not valid |
object_error | in case of any other error |
parent | the parent object with attributes |
object_imp pni::io::nx::h5::get_parent | ( | const object_imp & | obj | ) |
Returns the parent object. If the current object is group or a field the returned object is always a group. In the case of an attribute the parent can be either a group or a field.
invalid_object_error | if object not valid |
object_error | in case of any other error |
type_error | if the type of the object is unkown or could not be determined |
io_error | in case of any IO related errors |
obj | reference to the object from which to retrieve the parent |
string pni::io::nx::h5::get_parent_path | ( | const object_imp & | object | ) |
Return the path to the parent of a particular object. Supported HDf5 types are
invalid_object_error | if object is not valid |
io_error | in case of errors |
object_error | if validity check fails |
type_error | if the object is of an inappropriate type |
object | the HDF5 object from which to retrieve the parent path |
string pni::io::nx::h5::get_path | ( | const object_imp & | object | ) |
Return the path of an HDF5 object as a string. This function works for the following HDF5 object types
object_error | if object validity cannot be verified |
invalid_object_error | if the object is not valid |
io_error | in case of any IO related error. |
type_error | object is not a group or dataset |
object | reference to the object from which to retrieve the path |
const h5datatype& pni::io::nx::h5::get_type | ( | pni::core::type_id_t | id | ) |
type_error | if id has no corresponding HDF5 data type |
id | type id for which to requeste an HDF5 datatype |
bool pni::io::nx::h5::has_attribute | ( | const object_imp & | parent, |
const pni::core::string & | name | ||
) |
Checks if an attribute exists and returns true if it does. Otherwise false will be returned.
invalid_object_error | if parent object not valid |
object_error | in case of any other errors |
parent | the parent object where we look for the attribute |
name | the name of the attribute to look for |
bool pni::io::nx::h5::is_static_string | ( | const h5datatype & | type | ) |
Returns true if the data type represents a static length string. If type is not a string type at all false will be returned.
object_error | if information retrieval fails |
invalid_object_error | if object not valid |
type_error | if data type is not supported |
type | instance of h5datatype |
bool pni::io::nx::h5::is_vl_string | ( | const h5datatype & | type | ) |
Returns true if the data type represents a variable length string type.
object_error | if type inquery fails |
invalid_object_error | if type is not valid |
type_error | if the datatype is not supported |
type | a type instance |
h5datatype pni::io::nx::h5::make_type | ( | pni::core::type_id_t | id | ) |
type_error | if the ID has no HDF5 counterpart |
id | type id |
bool pni::io::nx::h5::operator!= | ( | const h5datatype & | a, |
const h5datatype & | b | ||
) |
object_error | if comparison fails |
a | lhs value of the operator |
b | rhs value of the operator |
bool pni::io::nx::h5::operator!= | ( | const object_imp & | a, |
const object_imp & | b | ||
) |
Simply the inverse of the equality operator.
object_error | in case of errors |
type_error | if object type cannot be determined |
a | lhs value of the operator |
b | rhs value of the operator |
std::ostream & pni::io::nx::h5::operator<< | ( | std::ostream & | o, |
const h5dataspace & | s | ||
) |
invalid_object_error | if dataspace is not valid |
o | output stream |
s | HDF5 dataspace |
bool pni::io::nx::h5::operator== | ( | const h5datatype & | a, |
const h5datatype & | b | ||
) |
object_error | if comparison fails |
a | lhs value of the operator |
b | rhs value of the operator |
bool pni::io::nx::h5::operator== | ( | const object_imp & | a, |
const object_imp & | b | ||
) |
Operator checks if two HDF5 object are equal. This check is done by comparing the address of the objects in the file. If they share the same address the objects should be equal. Invalid objects are considered as not equal.
object_error | in case of errors |
type_error | if object type cannot be determined |
a | lhs value of the operator |
b | rhs value of the operator |
|
noexcept |
Get the number of elements referenced by the selection.
s | selection instance |
size_t pni::io::nx::h5::static_string_size | ( | const h5datatype & | type | ) |
Return the size of the strings for a static string size type.
type_error | if type is not a static string type |
invalid_type_error | if the type is not valid |
object_error | in any other case |
type | the datatype from which to retrieve the string size |
type_id_t pni::io::nx::h5::type_id | ( | const h5datatype & | o | ) |
Obtain the type code of a datatype object
type_error | if the passed datatype is not known |
invalid_object_error | if the data type instance is not valid |
object_error | in case of any other error |
o | instance of an HDF5 datat type |