h5cpp
0.3.3
A modern C++ wrapper for the HDF5 C library
|
Classes | |
class | ChunkedDataset |
dataset with chunked layout More... | |
class | Dataset |
class | Group |
class | GroupView |
base class for group views More... | |
class | Link |
a link More... | |
class | LinkIterator |
class | LinkTarget |
link target descriptor More... | |
class | LinkView |
class | Node |
class | NodeIterator |
bidirectional NodeIterator More... | |
class | NodeView |
class | RecursiveLinkIterator |
recursive Link iterator More... | |
class | RecursiveNodeIterator |
recursive node iterator More... | |
class | VirtualDataset |
virtual dataset class More... | |
Enumerations | |
enum | Type : std::underlying_type< H5O_type_t >::type { Type::UNKNOWN = H5O_TYPE_UNKNOWN, Type::GROUP = H5O_TYPE_GROUP, Type::DATASET = H5O_TYPE_DATASET, Type::DATATYPE = H5O_TYPE_NAMED_DATATYPE } |
enumeration for node type More... | |
enum | LinkType : std::underlying_type< H5L_type_t >::type { LinkType::HARD = H5L_TYPE_HARD, LinkType::SOFT = H5L_TYPE_SOFT, LinkType::EXTERNAL = H5L_TYPE_EXTERNAL, LinkType::ERROR = H5L_TYPE_ERROR } |
Functions | |
DLL_EXPORT void | resize_by (const Dataset &dataset, size_t dimension_index, ssize_t delta) |
resize a dataset by a particular offset More... | |
DLL_EXPORT void | copy (const Node &source, const Group &base, const Path &relative_path, const property::ObjectCopyList &ocpl=property::ObjectCopyList(), const property::LinkCreationList &lcpl=property::LinkCreationList()) |
copy node object More... | |
DLL_EXPORT void | copy (const Node &source, const Group &destination, const property::ObjectCopyList &ocpl=property::ObjectCopyList(), const property::LinkCreationList &lcpl=property::LinkCreationList()) |
copy node object More... | |
DLL_EXPORT void | move (const Node &source, const Group &base, const Path &relative_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList()) |
move node object More... | |
DLL_EXPORT void | move (const Node &source, const Group &destination, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList()) |
move node object More... | |
DLL_EXPORT void | remove (const Group &base, const Path &object_path, const property::LinkAccessList &lapl=property::LinkAccessList()) |
remove node from group More... | |
DLL_EXPORT void | remove (const Node &object, const property::LinkAccessList &lapl=property::LinkAccessList()) |
remove node from group More... | |
DLL_EXPORT void | link (const Node &target, const Group &link_base, const Path &link_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList()) |
Create a soft or external link. More... | |
DLL_EXPORT void | link (const Path &target_path, const Group &link_base, const Path &link_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList()) |
Create a soft link. More... | |
DLL_EXPORT void | link (const boost::filesystem::path &target_file, const Path &target_path, const Group &link_base, const Path &link_path, const property::LinkCreationList &lcpl=property::LinkCreationList(), const property::LinkAccessList &lapl=property::LinkAccessList()) |
Create an external link. More... | |
DLL_EXPORT Node | get_node (const Group &base, const Path &node_path, const property::LinkAccessList &lapl=property::LinkAccessList()) |
get node More... | |
DLL_EXPORT Group | get_real_base (const Group &base, const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList()) |
get real base of path More... | |
DLL_EXPORT Group | get_group (const Group &base, const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList()) |
get group More... | |
DLL_EXPORT Dataset | get_dataset (const Group &base, const Path &path, const property::LinkAccessList &lapl=property::LinkAccessList()) |
get dataset More... | |
DLL_EXPORT bool | is_group (const Node &node) |
predicate function returning true if node is a group More... | |
DLL_EXPORT bool | is_dataset (const Node &node) |
predicate function returning true if a node is a dataset More... | |
DLL_EXPORT bool | operator!= (const Link &lhs, const Link &rhs) |
DLL_EXPORT std::ostream & | operator<< (std::ostream &stream, const Link &link) |
DLL_EXPORT bool | operator== (const Node &lhs, const Node &rhs) |
DLL_EXPORT bool | operator!= (const Node &lhs, const Node &rhs) |
DLL_EXPORT std::ostream & | operator<< (std::ostream &stream, const Type &type) |
DLL_EXPORT std::ostream & | operator<< (std::ostream &stream, const LinkType &type) |
|
strong |
|
strong |
DLL_EXPORT void hdf5::node::copy | ( | const Node & | source, |
const Group & | base, | ||
const Path & | relative_path, | ||
const property::ObjectCopyList & | ocpl = property::ObjectCopyList() , |
||
const property::LinkCreationList & | lcpl = property::LinkCreationList() |
||
) |
Copy source
object to a new relative_path
under base
Group. If an object of same name already exists an exception will be thrown.
The copy operation should also work across file boundaries. In all cases the source object as well as the destination group must exist.
source | object to be copied |
base | the destination base group where the new copy will be stored |
relative_path | the destination relative path under the base group |
ocpl | optional object copy property list |
lcpl | optional link creation property list |
std::runtime_error | in case of a failure |
DLL_EXPORT void hdf5::node::copy | ( | const Node & | source, |
const Group & | destination, | ||
const property::ObjectCopyList & | ocpl = property::ObjectCopyList() , |
||
const property::LinkCreationList & | lcpl = property::LinkCreationList() |
||
) |
Copy source
object to a new location under destination
Group using the original object's name. For instance, if we have
then the copy will appear as /recorded/detectors/data. If an object of same name already exists an exception will be thrown.
The copy operation should also work across file boundaries. In all cases the source object as well as the destination group must exist.
source | object to be copied |
destination | the destination group where the new copy will be stored |
ocpl | optional object copy property list |
lcpl | optional link creation property list |
std::runtime_error | in case of a failure |
DLL_EXPORT Dataset hdf5::node::get_dataset | ( | const Group & | base, |
const Path & | path, | ||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
A convenience function for get_node. Returns a Dataset instance if the node referenced by path
is a dataset, otherwise throws an exception. Use this function whenever you want to work with a Dataset temporarily.
For instance
std::runtime_error | in case of a failure |
base | base group |
path | path to dataset |
lapl | optional link access property list |
DLL_EXPORT Group hdf5::node::get_group | ( | const Group & | base, |
const Path & | path, | ||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
A convenience function for get_node. Returns a Group instance if the node referenced by path
is a group, otherwise throws an exception. Use this function whenever you want to work with a Group temporarily.
For instance
std::runtime_error | in case of a failure |
base | base group |
path | path to group |
lapl | optional link access property list |
DLL_EXPORT Node hdf5::node::get_node | ( | const Group & | base, |
const Path & | node_path, | ||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Get a node from a base group.
std::runtime_error | in case of a failure |
base | reference to the base group |
node_path | reference to the path of the node |
lapl | optional link access property list |
DLL_EXPORT Group hdf5::node::get_real_base | ( | const Group & | base, |
const Path & | path, | ||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Helper function to facilitate a number of convenience functions in the wrapper. Gets the most proximate parent Group of path
. If path
is absolute, base
will only be used to obtain the root node of the file. If the parent node does not exist or is not a Group, an exception will be thrown.
std::runtime_error | in case of a failure |
base | base group for link |
path | path of desired node |
lapl | optional link access property list |
DLL_EXPORT bool hdf5::node::is_dataset | ( | const Node & | node | ) |
This predicate function is used to filter dataset nodes. A typical application would be for instance
or whenever you want to partition a vector
std::runtime_error | in case of a failure |
node | reference to the node |
DLL_EXPORT bool hdf5::node::is_group | ( | const Node & | node | ) |
This predicate function is used to filter group nodes. A typical application would be for instance
or whenever you want to partition a vector
std::runtime_error | in case of a failure |
node | reference to the node |
DLL_EXPORT void hdf5::node::link | ( | const Node & | target, |
const Group & | link_base, | ||
const Path & | link_path, | ||
const property::LinkCreationList & | lcpl = property::LinkCreationList() , |
||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Create a link from link_path
under link_base
to object at target_path
under target_base
. A soft link will be created if link_base
and target_base
reside in the same file. Otherwise an external link is created.
The target for the link is determined by target_base
and target_path
. If the latter one is a relative path the target location is assumed relative to target_base
. If it is an absolute path, target_base
is used to retrieve the root group of the specific file.
target | the target node (could also be path here?) |
link_base | the base group for the link location |
link_path | path to the new link (either relative or absolute) |
lcpl | optional link creation property list |
lapl | optional link access property list |
DLL_EXPORT void hdf5::node::link | ( | const Path & | target_path, |
const Group & | link_base, | ||
const Path & | link_path, | ||
const property::LinkCreationList & | lcpl = property::LinkCreationList() , |
||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Create a link from link_path
under link_base
to object at target_path
. The object at target_path
need not already exist at this time.
If the target_path
is a relative path the target location is assumed relative to link_base
. If absolute, the path is assumed to be on the same file as link_base
.
target | the target node (could also be path here?) |
link_base | the base group for the link location |
link_path | path to the new link (either relative or absolute) |
lcpl | optional link creation property list |
lapl | optional link access property list |
DLL_EXPORT void hdf5::node::link | ( | const boost::filesystem::path & | target_file, |
const Path & | target_path, | ||
const Group & | link_base, | ||
const Path & | link_path, | ||
const property::LinkCreationList & | lcpl = property::LinkCreationList() , |
||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Create an external link to an object stored in a different file. The target object is determined by the target file and an absolute path within this file. The location of the link is given by a base group and a relative or absolute path. If link_path is a relative path the new link will be relative to link_base
. Otherwise link_base
is only used to determine the root group (and thus the file within which the link is placed).
std::runtime_error | in case of a failure |
target_file | the file where the link target is stored |
target_path | absolute path to the object which we want to reference in the target file |
link_base | base group for the link |
link_path | absolute or relative path to the new link |
lcpl | optional link creation property list |
lapl | optional link access property list |
target_path
must be an absolute path link_base
must be a valid HDF5 object DLL_EXPORT void hdf5::node::move | ( | const Node & | source, |
const Group & | base, | ||
const Path & | relative_path, | ||
const property::LinkCreationList & | lcpl = property::LinkCreationList() , |
||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Move source
object to a new relative_path
under base
Group. If an object of same name already exists an exception will be thrown. In all cases the source object as well as the destination group must exist.
source | object to be moved |
base | the destination base group where the object will be moved |
relative_path | the destination relative path under the base group |
lcpl | optional link creation property list |
lapl | optional link access property list |
std::runtime_error | in case of a failure |
DLL_EXPORT void hdf5::node::move | ( | const Node & | source, |
const Group & | destination, | ||
const property::LinkCreationList & | lcpl = property::LinkCreationList() , |
||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Move source
object to a new location under destination
Group using the original object's name. For instance, if we have
then the moved object will appear as /recorded/detectors/data. If an object of same name already exists an exception will be thrown. In all cases the source object as well as the destination group must exist.
source | object to be moved |
destination | the new group where the object should be located |
lcpl | optional link creation property list |
lapl | optional link access property list |
std::runtime_error | in case of a failure |
DLL_EXPORT bool hdf5::node::operator!= | ( | const Node & | lhs, |
const Node & | rhs | ||
) |
DLL_EXPORT bool hdf5::node::operator!= | ( | const Link & | lhs, |
const Link & | rhs | ||
) |
DLL_EXPORT std::ostream& hdf5::node::operator<< | ( | std::ostream & | stream, |
const Type & | type | ||
) |
DLL_EXPORT std::ostream& hdf5::node::operator<< | ( | std::ostream & | stream, |
const LinkType & | type | ||
) |
DLL_EXPORT std::ostream& hdf5::node::operator<< | ( | std::ostream & | stream, |
const Link & | link | ||
) |
DLL_EXPORT bool hdf5::node::operator== | ( | const Node & | lhs, |
const Node & | rhs | ||
) |
DLL_EXPORT void hdf5::node::remove | ( | const Group & | base, |
const Path & | object_path, | ||
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Removes link at object_path
within the base
Group. If there are more references (links) to this particular object, they remain active. Additionally: removing an object entirely from an HDF5 file means removing all links to this object and thus rendering it inaccessible. No storage space in the file will be cleared. In order to reduce the size of the file h5repack
must be used which will simply not copy objects which cannot be referenced.
std::runtime_error | in case of a failure |
base | group relative to which the link or object resides |
object_path | path relative to base determining the link or object to remove |
lapl | optional link access property list |
DLL_EXPORT void hdf5::node::remove | ( | const Node & | object, |
const property::LinkAccessList & | lapl = property::LinkAccessList() |
||
) |
Removes link to object
from parent Group via which it was accessed.
std::runtime_error | in case of a failure |
object | the object which to remove |
object
must be a valid HDF5 object instance lapl | optional link access property list |
DLL_EXPORT void hdf5::node::resize_by | ( | const Dataset & | dataset, |
size_t | dimension_index, | ||
ssize_t | delta | ||
) |
Resizes a dataset along the dimension determined by dimension_index by delta elements. As delta is a signed integer one can either enlarge or shrink the dataset.
dataset | reference to the dataset to resize |
dimension_index | the index of the dimension to resize |
delta | the number of elements about which the dataset should be resized |
std::runtime_error | in case of any failure |