libpniio
Data Structures | Typedefs | Enumerations | Functions | Variables
pni::io::nx::h5 Namespace Reference

Data Structures

class  attribute_imp
 attribute implementation More...
 
class  charpad_formatter
 
struct  complex_struct
 
class  field_factory
 factory for field construction More...
 
class  field_imp
 dataset object More...
 
class  file_imp
 HDF5 file implementation. More...
 
class  group_imp
 HDF5 group object. More...
 
class  h5_error
 HDF5 error record. More...
 
class  h5_error_stack
 HDF5 error stack. More...
 
class  h5dataspace
 dataspace object More...
 
class  h5datatype
 HDF5 type wrapper. More...
 
class  h5deflate_filter
 HDF5 deflate filter. More...
 
class  h5filter
 base class for filter implementations More...
 
class  h5link
 
class  nullterm_formatter
 
class  object_imp
 basic HDF5 ID wrapper More...
 
class  selection
 describe a selection in an HDF5 file More...
 
class  selection_guard
 selection guard More...
 
class  string_formatter
 abstract string reader class More...
 
class  string_formatter_factory
 abstract string reader class More...
 
struct  type_imp
 provide implementation specific types More...
 

Typedefs

using nxfile = pni::io::nx::nxfile< nximp_code::HDF5 >
 
using nxgroup = pni::io::nx::nxgroup< nximp_code::HDF5 >
 
using nxfield = pni::io::nx::nxfield< nximp_code::HDF5 >
 
using nxfilter = pni::io::nx::nxfilter< nximp_map< nximp_code::HDF5 >::filter_imp >
 
using nxdeflate_filter = pni::io::nx::nxdeflate_filter< nximp_map< nximp_code::HDF5 >::deflate_imp >
 
using nxattribute = pni::io::nx::nxattribute< nximp_code::HDF5 >
 
using nxlink = pni::io::nx::nxlink< nximp_code::HDF5 >
 
using nxobject = pni::io::nx::nxobject< nxgroup, nxfield, nxattribute, nxlink >
 
typedef std::pair< type_id_t,
h5datatype
id_type_pair_t
 
typedef std::vector
< id_type_pair_t
id_type_pairs_t
 
typedef std::unique_ptr
< string_formatter
formatter_ptr
 
typedef std::vector< char > char_vector_type
 vector type for individual characters More...
 
typedef std::vector< char * > char_ptr_vector_type
 vector tyep for char pointers More...
 
typedef std::vector< const char * > char_const_ptr_vector_type
 vector type for const char pointers More...
 

Enumerations

enum  h5object_type {
  h5object_type::FILE, h5object_type::GROUP, h5object_type::DATATYPE, h5object_type::DATASPACE,
  h5object_type::DATASET, h5object_type::ATTRIBUTE, h5object_type::PLIST, h5object_type::BADID
}
 HDF5 object type enumerations. More...
 

Functions

bool has_attribute (const object_imp &parent, const pni::core::string &name)
 checks for an attributes existence More...
 
void delete_attribute (const object_imp &parent, const pni::core::string &name)
 Deletes an attribute. More...
 
object_imp 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 get_attribute_by_name (const object_imp &parent, const pni::core::string &n)
 open attribute by name More...
 
size_t get_number_of_attributes (const object_imp &parent)
 get number of attributes More...
 
object_imp get_attribute_by_index (const object_imp &parent, size_t i)
 open attribute by index More...
 
std::ostream & operator<< (std::ostream &o, const h5_error &e)
 ouput stream operator More...
 
std::ostream & operator<< (std::ostream &o, const h5_error_stack &s)
 ostream operator More...
 
herr_t _error_walker (unsigned n, const H5E_error2_t *eptr, void *client_data)
 Walker functins to read over error messages. More...
 
pni::core::string get_h5_error_string ()
 return HDF5 error messages More...
 
std::ostream & operator<< (std::ostream &o, const h5dataspace &s)
 output operator More...
 
bool operator== (const h5datatype &a, const h5datatype &b)
 equality comparison More...
 
bool operator!= (const h5datatype &a, const h5datatype &b)
 inequality More...
 
pni::core::type_id_t type_id (const h5datatype &o)
 get type code More...
 
const h5datatypeget_type (pni::core::type_id_t id)
 get reference to type More...
 
h5datatype make_type (pni::core::type_id_t id)
 create new type More...
 
h5object_type get_hdf5_type (const object_imp &o)
 return HDF5 type More...
 
pni::io::nx::nxobject_type get_nexus_type (const object_imp &o)
 return Nexus type More...
 
pni::core::string get_filename (const object_imp &object)
 get object filename More...
 
pni::core::string get_path (const object_imp &object)
 get object path More...
 
pni::core::string get_name (const object_imp &obj)
 return object name More...
 
pni::core::string get_parent_path (const object_imp &object)
 get parent path More...
 
object_imp get_parent (const object_imp &obj)
 return the parent object More...
 
bool operator== (const object_imp &a, const object_imp &b)
 equality operator More...
 
bool operator!= (const object_imp &a, const object_imp &b)
 inequality operator More...
 
size_t effective_rank (const selection &s) noexcept
 get effective rank More...
 
type_imp::index_vector_type effective_shape (const selection &s)
 get effective shape More...
 
size_t size (const selection &s) noexcept
 get selection size More...
 
selection create_selection (const type_imp::selection_vector_type &s)
 
type_imp::selection_vector_type create_slice_vector (const selection &s)
 
bool is_family_filename (const string &fname)
 
template<typename CT >
h5datatype create_complex ()
 
h5datatype create_bool ()
 
h5datatype create_string ()
 
h5datatype create_static_string ()
 
h5datatype create_binary ()
 
const h5datatypeget_type (type_id_t id)
 
h5datatype make_type (type_id_t id)
 
string get_attribute_name (const object_imp &object)
 
string get_others_name (const object_imp &object)
 
object_imp get_object_parent (const object_imp &obj)
 
object_imp get_attribute_parent (const object_imp &obj)
 
bool check_type_equality (const object_imp &a, const object_imp &b)
 
bool check_plist_equality (const object_imp &a, const object_imp &b)
 
bool check_object_equality (const object_imp &a, const object_imp &b)
 
bool is_string_type (const h5datatype &type)
 
bool is_vl_string (const h5datatype &type)
 check variable length string More...
 
bool is_static_string (const h5datatype &type)
 check if static length string More...
 
bool is_ascii_string (const h5datatype &type)
 check if string type is ASCII More...
 
size_t static_string_size (const h5datatype &type)
 get static string size More...
 
void copy_from_vector (const char_vector_type &vector, size_t nstrs, size_t strsize, string *strings, const formatter_ptr &formatter)
 
void copy_from_vector (const char_ptr_vector_type &vector, size_t nstrs, string *strings, const formatter_ptr &formatter)
 
bool is_nullterm_str (const h5datatype &type)
 
bool is_nullpad_str (const h5datatype &type)
 
bool is_spacepad_str (const h5datatype &type)
 
void 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 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...
 

Variables

static const std::map
< type_id_t, h5datatype
__base_type_map
 
static const std::map
< type_id_t, h5datatype
__id_2_type_map
 
static const id_type_pairs_t id_type_pairs
 

Typedef Documentation

typedef std::vector<char> pni::io::nx::h5::char_vector_type

This type is mainly used for reading strings of static size from a field or attribute.

typedef std::pair<type_id_t,h5datatype> pni::io::nx::h5::id_type_pair_t

Function Documentation

bool pni::io::nx::h5::check_object_equality ( const object_imp &  a,
const object_imp &  b 
)
bool pni::io::nx::h5::check_plist_equality ( const object_imp &  a,
const object_imp &  b 
)
bool pni::io::nx::h5::check_type_equality ( const object_imp &  a,
const object_imp &  b 
)
void pni::io::nx::h5::copy_from_vector ( const char_vector_type &  vector,
size_t  nstrs,
size_t  strsize,
string *  strings,
const formatter_ptr &  formatter 
)
void pni::io::nx::h5::copy_from_vector ( const char_ptr_vector_type &  vector,
size_t  nstrs,
string *  strings,
const formatter_ptr &  formatter 
)
h5datatype pni::io::nx::h5::create_binary ( )
h5datatype pni::io::nx::h5::create_bool ( )
template<typename CT >
h5datatype pni::io::nx::h5::create_complex ( )
h5datatype pni::io::nx::h5::create_static_string ( )
h5datatype pni::io::nx::h5::create_string ( )
string pni::io::nx::h5::get_attribute_name ( const object_imp &  object)
object_imp pni::io::nx::h5::get_attribute_parent ( const object_imp &  obj)
object_imp pni::io::nx::h5::get_object_parent ( const object_imp &  obj)
string pni::io::nx::h5::get_others_name ( const object_imp &  object)
const h5datatype& pni::io::nx::h5::get_type ( type_id_t  id)
bool pni::io::nx::h5::is_ascii_string ( const h5datatype &  type)

Return true if the datatype represents an ASCII string, false otherwise

Exceptions
object_errorif information retrieval fails
invalid_object_errorif the data type is not valid
type_errorif the data type is not supported
Parameters
typeinstance of an HDF5 data type
Returns
true if the type is an ASCII string type, false otherwise
bool pni::io::nx::h5::is_family_filename ( const string &  fname)
bool pni::io::nx::h5::is_nullpad_str ( const h5datatype &  type)
bool pni::io::nx::h5::is_nullterm_str ( const h5datatype &  type)
bool pni::io::nx::h5::is_spacepad_str ( const h5datatype &  type)
bool pni::io::nx::h5::is_string_type ( const h5datatype &  type)
h5datatype pni::io::nx::h5::make_type ( type_id_t  id)

Variable Documentation

const std::map<type_id_t,h5datatype> pni::io::nx::h5::__base_type_map
static
Initial value:
=
{
{type_id_t::UINT8,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT8)))},
{type_id_t::INT8,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT8)))},
{type_id_t::UINT16,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT16)))},
{type_id_t::INT16,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT16)))},
{type_id_t::UINT32,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT32)))},
{type_id_t::INT32,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT32)))},
{type_id_t::UINT64,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT64)))},
{type_id_t::INT64,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT64)))},
{type_id_t::FLOAT32,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_FLOAT)))},
{type_id_t::FLOAT64,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_DOUBLE)))},
{type_id_t::FLOAT128,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_LDOUBLE)))}
}
const std::map<type_id_t,h5datatype> pni::io::nx::h5::__id_2_type_map
static
Initial value:
=
{
{type_id_t::UINT8,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT8)))},
{type_id_t::INT8,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT8)))},
{type_id_t::UINT16,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT16)))},
{type_id_t::INT16,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT16)))},
{type_id_t::UINT32,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT32)))},
{type_id_t::INT32,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT32)))},
{type_id_t::UINT64,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_UINT64)))},
{type_id_t::INT64,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_INT64)))},
{type_id_t::FLOAT32,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_FLOAT)))},
{type_id_t::FLOAT64,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_DOUBLE)))},
{type_id_t::FLOAT128,h5datatype(object_imp(H5Tcopy(H5T_NATIVE_LDOUBLE)))},
{type_id_t::COMPLEX32,create_complex<complex32>()},
{type_id_t::COMPLEX64,create_complex<complex64>()},
{type_id_t::COMPLEX128,create_complex<complex128>()},
{type_id_t::BOOL,create_bool()},
{type_id_t::STRING,create_string()},
{type_id_t::BINARY,create_binary()}
}
h5datatype create_bool()
Definition: h5datatype.cpp:93
h5datatype create_binary()
Definition: h5datatype.cpp:144
h5datatype create_string()
Definition: h5datatype.cpp:102
const id_type_pairs_t pni::io::nx::h5::id_type_pairs
static
Initial value:
=
{
id_type_pair_t{type_id_t::UINT8, CREATE_DTYPE(H5T_NATIVE_UINT8)},
id_type_pair_t{type_id_t::INT8, CREATE_DTYPE(H5T_NATIVE_INT8)},
id_type_pair_t{type_id_t::UINT16, CREATE_DTYPE(H5T_NATIVE_UINT16)},
id_type_pair_t{type_id_t::INT16, CREATE_DTYPE(H5T_NATIVE_INT16)},
id_type_pair_t{type_id_t::UINT32, CREATE_DTYPE(H5T_NATIVE_UINT32)},
id_type_pair_t{type_id_t::INT32, CREATE_DTYPE(H5T_NATIVE_INT32)},
id_type_pair_t{type_id_t::UINT64, CREATE_DTYPE(H5T_NATIVE_UINT64)},
id_type_pair_t{type_id_t::INT64, CREATE_DTYPE(H5T_NATIVE_INT64)},
id_type_pair_t{type_id_t::FLOAT32, CREATE_DTYPE(H5T_NATIVE_FLOAT)},
id_type_pair_t{type_id_t::FLOAT64, CREATE_DTYPE(H5T_NATIVE_DOUBLE)},
id_type_pair_t{type_id_t::FLOAT128,CREATE_DTYPE(H5T_NATIVE_LDOUBLE)},
id_type_pair_t{type_id_t::COMPLEX32, create_complex<complex32>()},
id_type_pair_t{type_id_t::COMPLEX64, create_complex<complex64>()},
id_type_pair_t{type_id_t::COMPLEX128,create_complex<complex128>()},
id_type_pair_t{type_id_t::BOOL, create_bool()},
id_type_pair_t{type_id_t::STRING,create_string()},
id_type_pair_t{type_id_t::STRING,create_static_string()},
id_type_pair_t{type_id_t::BINARY,create_binary()}
}
h5datatype create_bool()
Definition: h5datatype.cpp:93
h5datatype create_static_string()
Definition: h5datatype.cpp:124
h5datatype create_binary()
Definition: h5datatype.cpp:144
h5datatype create_string()
Definition: h5datatype.cpp:102
#define CREATE_DTYPE(native_type)
Definition: h5datatype.cpp:171
std::pair< type_id_t, h5datatype > id_type_pair_t
Definition: h5datatype.cpp:38