libpniio
|
#include <h5link.hpp>
Static Public Member Functions | |
static auto | link_name (const group_imp &loc, size_t index) -> pni::core::string |
get link name More... | |
static auto | link_target (const group_imp &loc, size_t index) -> pni::io::nx::nxpath |
get link target More... | |
static auto | link_target (const group_imp &loc, const pni::core::string &name) -> pni::io::nx::nxpath |
get link target More... | |
static void | create_external_link (const nxpath &target, const group_imp &loc, const pni::core::string &name) |
create an external link More... | |
static void | create_internal_link (const nxpath &target, const group_imp &loc, const pni::core::string &name) |
create an internal link More... | |
static auto | link_type (const group_imp &loc, const pni::core::string &name) -> pni::io::nx::nxlink_type |
get link type More... | |
Static Private Member Functions | |
static pni::core::string | _nx2hdf5path (const nxpath &p) |
convert a Nexus path to an HDF5 path More... | |
static void | check_if_valid (const group_imp &loc, const pni::core::exception_record &record, const pni::core::string &message) |
check if parent is valid More... | |
static void | check_if_exists (const group_imp &loc, const pni::core::string &lname, const pni::core::exception_record &record, const pni::core::string &message="") |
check if link exists More... | |
static void | check_if_exists (const group_imp &loc, size_t index, const pni::core::exception_record &record, const pni::core::string &message="") |
check if link exists More... | |
static H5L_info_t | get_link_info (const group_imp &loc, const pni::core::string &name) |
get link info by name More... | |
static H5L_info_t | get_link_info (const group_imp &loc, size_t index) |
get link info by index More... | |
static auto | get_link_value (const group_imp &loc, const pni::core::string &lname) -> pni::core::string |
return the link value More... | |
static auto | get_external_link_target (const group_imp &loc, const pni::core::string &lname) -> pni::io::nx::nxpath |
return external target More... | |
static auto | get_soft_link_target (const group_imp &loc, const pni::core::string &lname) -> pni::io::nx::nxpath |
return internal target More... | |
This class holds only static methods which can be used to create internal and external links.
|
staticprivate |
This static method converts a Nexus path to an HDF5 path. HDF5 requires that all group and field names are given. Thus, one cannot use just the groups class to identify a group. If the name of a group or field is not given a pni::core::value_error is thrown.
pni::core::value_error | if element name is missing |
p | Nexus path object |
|
staticprivate |
Checks if a link of name lname exists below group loc. This function assumes that loc is a valid HDF5 group. In case of doubts check_if_valid should be called before.
key_error | if link does not exist |
loc | the parent group for the link |
lname | the name of the link |
record | the exception record at the position of the check |
message | a custom error message that will be added to the default message |
|
staticprivate |
Checks if a link with a particular index exists. This function does nothing else than checking if index does not exceed the total number of links below the parent group. The function asssumes that loc is a valid HDF5 group. In case of doubts call check_if_valid before.
index_error | if index exceeds the total number of links |
loc | parent HDF5 group |
index | the index of the link |
record | exception record of the check |
message | optional message which will be added to the default error message |
|
staticprivate |
Static member function checking if the parent object is valid. Otherwise pni::io::invalid_object_error will be thrown.
invalid_object_error | if loc is not valid |
loc | reference to the parent object |
record | exception record at the location where the test should be performed |
message | error message |
|
static |
The target path for an external link must be a full Nexus path including a filename. If it does not contain a filename nxlink_error will be thrown. name determines the name of the link as a child of loc. The target path must not contain element without a name (HDF5 cannot handle such situations) otherwise a value_error exception will be thrown.
invalid_object_error | if loc is not valid |
link_error | if link creation fails |
value_error | for malformed paths |
object_error | in case of any other error |
target | path of the links target |
loc | location where the link should be created |
name | linkname below loc |
|
static |
Unlike for external links in the target path can be either absolute in the file or relative to loc. name determines the name of the link below loc. target_path must not have elements without a name. In such a case a value_error will be thrown. In addition the target_path Nexus path must not contain a file name.
invalid_object_error | if loc is not valid |
value_error | in case of a malformed path |
link_error | if link creation fails |
object_error | in case of any other error |
target | path to the links target |
loc | location for the new link |
name | name of the object below loc |
|
staticprivate |
Return the target of an external link as an instance of nxpath.
invalid_object_error | if loc is not a valid group |
key_error | if a linke lname does not exist |
link_error | in case that the value cannot be retrieved |
object_error | in case of any other error |
loc | parent group |
lname | name of the link |
|
staticprivate |
Returns the info structure for a link of anme name.
invalid_object_error | if loc is not a valid group |
key_error | if a link fo name name does not exist |
object_error | in case of any other error |
loc | parent group of the link |
name | the name of the link |
|
staticprivate |
Returns the info structure for the link determined by index.
invalid_object_error | if loc is not a valid group |
index_error | if index exceeds the total number of links below the parent group |
object_error | in case of any other error |
loc | parent group of the link |
index | link index |
|
staticprivate |
Return the link value. In HDF5 the link value is the target to which a link referes to.
invalid_object_error | if loc is not a valid group |
key_error | if a linke lname does not exist |
link_error | in case that the value cannot be retrieved |
object_error | in case of any other error |
|
staticprivate |
Return the target of an internal link as an instance of nxpath.
invalid_object_error | if loc is not a valid group |
key_error | if a linke lname does not exist |
link_error | in case that the value cannot be retrieved |
object_error | in case of any other error |
loc | parent group |
lname | name of the link |
|
static |
Return the name of the link with index index.
invalid_object_error | if loc is not a valid group |
index_error | if index exceeds the total number of links below loc |
object_error | in case of any other error |
loc | the parent group object |
index | the index of the link |
|
static |
Return the target for the link with index index in group loc.
invalid_object_error | if loc is not a valid group |
index_error | if index exceeds the total number of links |
link_error | in case that the value cannot be retrieved |
object_error | in case of any other error |
loc | parent group of the link |
index | link index |
|
static |
Return the target for the link lname in group loc.
invalid_object_error | if loc is not a valid group |
key_error | if a linke lname does not exist |
link_error | in case that the value cannot be retrieved |
object_error | in case of any other error |
loc | parent group of the link |
lname | the name of the link |
|
static |
Returns the link type of a child of loc identified by its name.
invalid_object_error | if loc is not valid |
key_error | if the child could not be found |
link_error | if the link type could not be retrieved |
type_error | if the link type is unkown |
object_error | in case of any other error |
loc | parent group |
name | the name of the child |