IO Module

The IO module of HIPP provides

  • High-level, pure-OOP wrappers for the HDF5 library.

  • Extentions to simplify common I/O tasks.

  • Intermediate-level components that are mapped to the actual HDF5 library calls.

High-level HDF5 Objects

The basic high-level HDF5 objects are Dataspace, Proplist, Attr, Datatype, Dataset, Group, and File.

Among them, Datatype, Dataset, Group, and File are “named objects” that can be stored in files and connected by links. Addionally, a File object can be used where a Group object is needed (the “root” group is implicitly used by the library).

To reflect the logic relations of those objects, HIPP adopts the following inheritance graphs of them:

../../../_images/inheritance.svg

Fig. 10 The inheritance of HIPP HDF5 objects. Obj and NamedObj are two abstract object types that do not have actual related HDF5 resources.

The inheritance has strong impact on how the APIs of those objects are used. For example:

  • File inherits all methods from Group. Hence, you can create links, extract meta-info of them, visit/iterate links and sub objects, create/open datasets, from a File instance. These operations are applied to the root group of the file instace.

  • Datatype, Dataset, Group, and File inherit all methods from NamedObj. Therefore, they can create/open attributes and iterate over them, by using the API defined in NamedObj.

  • All of these types are sub class of Obj. Hence, the memory management API defined in Obj, such as Obj::raw(), Obj::free(), and Obj::has_referenced() can be used on instance of any HDF5 type.

However, some different methods that have the name do appear (static bind) both in the sub class and the parent class. For example:

  • Each class defines its own version of obj_raw() which returns a referene to intermediate-level HDF5 object counterpart. Therefore, file.obj_raw() returns _File&, while file.NamedObj::obj_raw() returns _NamedObj&.

  • Group and NamedObj both has its own version of get_info(), which returns the group meta-info and object-meta info, respectively. Hence, group.get_info() returns the group meta-info of the instance, while group.NamedObj::get_info() returns its meta-info as a named object. To simplify the usage, we do provide a method Group::get_object_info() which has the same effect of the later call.

List of High-level Components

Class

Corresponding HDF5 Standard C API

Details

File

H5F

File manipulation.

Group

H5G, H5L

Data group operations.

Dataset

H5D

Dataset operations.

Datatype

H5T

Type system.

Dataspace

H5S

Dataspace operations.

Proplist

H5P

Property list.

Attr

H5A

Attributes.

Obj

NamedObj

H5O

Base class of all HDF5 objects.

XTable

Base class of all named HDF5 objects.

Dimensions

Points

Chunk

Hyperslab

Datapacket, ConstDatapacket

Convert C++ object to H5 datatype and dataspace.

DatapacketScalar, ConstDatapacketScalar

Scalar versions of Datapacket.

DatapacketStr, ConstDatapacketStr

String versions of Datapacket.

High-level API

Extended API

Intermediate-level API