libpniio
|
![]() |
Typedefs | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
using | pni::io::nx::nxobject = boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > |
Enumerations | |
enum | pni::io::nx::nximp_code { pni::io::nx::nximp_code::HDF5 } |
implementation codes More... | |
enum | pni::io::nx::nxlink_type { pni::io::nx::nxlink_type::HARD, pni::io::nx::nxlink_type::SOFT, pni::io::nx::nxlink_type::EXTERNAL, pni::io::nx::nxlink_type::ATTRIBUTE } |
Nexus link type. More... | |
enum | pni::io::nx::nxlink_status { pni::io::nx::nxlink_status::VALID, pni::io::nx::nxlink_status::INVALID } |
Nexus link status. More... | |
enum | pni::io::nx::nxobject_type { pni::io::nx::nxobject_type::NXFIELD, pni::io::nx::nxobject_type::NXGROUP, pni::io::nx::nxobject_type::NXFILE, pni::io::nx::nxobject_type::NXATTRIBUTE, pni::io::nx::nxobject_type::NXNONE } |
Nexus typd ids. More... | |
Functions | |
template<template< nximp_code > class GTYPE, nximp_code IMPID> | |
flat_group< GTYPE< IMPID > > | pni::io::nx::make_flat (const GTYPE< IMPID > &group) |
create a flat group More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
flat_group< GTYPE > | pni::io::nx::make_flat (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &object) |
create a flat group More... | |
template<typename CTYPE , template< nximp_code > class GTYPE, nximp_code IMPID> | |
void | pni::io::nx::get_links (const GTYPE< IMPID > &parent, CTYPE &container) |
get list of links More... | |
template<typename CTYPE , template< nximp_code > class GTYPE, nximp_code IMPID> | |
CTYPE | pni::io::nx::get_links (const GTYPE< IMPID > &parent) |
get links below a group More... | |
template<typename CTYPE , template< nximp_code > class GTYPE, nximp_code IMPID> | |
void | pni::io::nx::get_links_recursive (const GTYPE< IMPID > &parent, CTYPE &container) |
get links recursively More... | |
template<typename CTYPE , template< nximp_code > class GTYPE, nximp_code IMPID> | |
CTYPE | pni::io::nx::get_links_recursive (const GTYPE< IMPID > &parent) |
get links recursively More... | |
template<nximp_code IMPID> | |
bool | pni::io::nx::operator== (const nxgroup< IMPID > &a, const nxgroup< IMPID > &b) |
group equality check More... | |
template<nximp_code IMPID> | |
bool | pni::io::nx::operator!= (const nxgroup< IMPID > &a, const nxgroup< IMPID > &b) |
group inequality check More... | |
template<template< nximp_code > class GTYPE, nximp_code IMPID> | |
void | pni::io::nx::link (const nxpath &target, const GTYPE< IMPID > &g, const pni::core::string &name) |
create a link More... | |
template<typename GTYPE > | |
void | pni::io::nx::link (const pni::core::string &target, const GTYPE &g, const pni::core::string &name) |
create a link More... | |
template<typename GTYPE > | |
void | pni::io::nx::link (const char *target, const GTYPE &g, const pni::core::string &name) |
create a link More... | |
template<typename STYPE , typename GTYPE > | |
void | pni::io::nx::link (const STYPE &target, const GTYPE &g, const pni::core::string &name) |
create a link More... | |
template<template< nximp_code > class GTYPE, nximp_code IMPID> | |
auto | pni::io::nx::link_type (const GTYPE< IMPID > &parent, const pni::core::string &name) -> nxlink_type |
return link type More... | |
template<typename GTYPE > | |
bool | pni::io::nx::is_external_link (const GTYPE &parent, const pni::core::string &name) |
return true if link is external More... | |
template<typename GTYPE > | |
bool | pni::io::nx::is_soft_link (const GTYPE &parent, const pni::core::string &name) |
return true if link is soft More... | |
template<typename GTYPE > | |
bool | pni::io::nx::is_hard_link (const GTYPE &parent, const pni::core::string &name) |
return true if link is hard More... | |
std::ostream & | pni::io::nx::operator<< (std::ostream &stream, const nxlink_type <ype) |
ouput operator for link type enumeration More... | |
This classes implement the basic components from which each nexus object is created.
using pni::io::nx::nxobject = typedef boost::variant<GTYPE,FTYPE,ATYPE,LTYPE> |
nxobject is an alias to a boost::variant template which can hold an instance of a group, a field, or an attribute. It can be thus used as a general container for all kind of Nexus objects.
|
strong |
|
strong |
|
strong |
This enumeration characterizes a particular type of a link. There are three kinds of links possible
Attributes to not have a link type. However, we define one to make the interfaces more consistent. The link type ATTRIBUTE thus tells a user that the object he is dealing with is an attribute attached to an object.
Enumerator | |
---|---|
HARD |
denotes a hard link |
SOFT |
denotes a soft link |
EXTERNAL |
denotes an external link |
ATTRIBUTE |
returned by attributes |
|
strong |
This enumeration class provides identifiers for different Nexus types. Basically there are only two types: fields and groups. Indeed a third is required if the objects does not belong to any of the two mentioned before.
Enumerator | |
---|---|
NXFIELD |
NXField identifier. |
NXGROUP |
NXGroup identifier. |
NXFILE |
NXFile identifier. |
NXATTRIBUTE |
attribute identifier |
NXNONE |
no valid Nexus object |
void pni::io::nx::get_links | ( | const GTYPE< IMPID > & | parent, |
CTYPE & | container | ||
) |
Appends the links below a parent group to a given container. Only the direct links are taken into account.
CTYPE | container type for the link |
GTYPE | NeXus group template |
IMPID | implementation ID |
parent | the parent group |
container | reference to the target container |
CTYPE pni::io::nx::get_links | ( | const GTYPE< IMPID > & | parent | ) |
Create a new container of type CTYPE and store all links below a parent group in it.
CTYPE | container type |
GTYPE | Nexus group template |
IMPID | implementation ID |
parent | the parent group for which to store the links |
void pni::io::nx::get_links_recursive | ( | const GTYPE< IMPID > & | parent, |
CTYPE & | container | ||
) |
Recursively iterate over a tree starting from a particular parent group and store all links in a container of type CTYPE. If the container already contains links the new ones are appended.
CTYPE | container type |
GTYPE | NeXus container template |
IMPID | NeXus implementation ID |
parent | starting point for the recursive iteration |
container | reference to the target container |
CTYPE pni::io::nx::get_links_recursive | ( | const GTYPE< IMPID > & | parent | ) |
CTYPE | container type |
GTYPE | group template |
IMPID | implementation ID |
parent | root group for iteration |
bool pni::io::nx::is_external_link | ( | const GTYPE & | parent, |
const pni::core::string & | name | ||
) |
Returns true if the link used for child name below parent is an external one.
invalid_object_error | if parent is not a valid group |
key_error | if parent has no child with name |
link_error | if link type could not be obtained |
type_error | if the link type is unkown |
object_error | in case of any other error |
GTYPE | parent type |
parent | instance of GTYPE |
name | child name |
bool pni::io::nx::is_hard_link | ( | const GTYPE & | parent, |
const pni::core::string & | name | ||
) |
Returns true if the link used for child name below parent is an hard one.
invalid_object_error | if parent is not a valid group |
key_error | if parent has no child with name |
link_error | if link type could not be obtained |
type_error | if the link type is unkown |
object_error | in case of any other error |
GTYPE | parent type |
parent | instance of GTYPE |
name | child name |
bool pni::io::nx::is_soft_link | ( | const GTYPE & | parent, |
const pni::core::string & | name | ||
) |
Returns true if the link used for child name below parent is an soft one.
invalid_object_error | if parent is not a valid group |
key_error | if parent has no child with name |
link_error | if link type could not be obtained |
type_error | if the link type is unkown |
object_error | in case of any other error |
GTYPE | parent type |
parent | instance of GTYPE |
name | child name |
void pni::io::nx::link | ( | const nxpath & | target, |
const GTYPE< IMPID > & | g, | ||
const pni::core::string & | name | ||
) |
Creates a link to an object referenced by target. The new link is created below g with name. If the location and the target reside within the same file or the target path has no filename set an internal link will be created. Consider the following example. Here we want to create a link from the data stored in a detector field (all within the same file).
In the next example the same link should be created but this time the detector data is stored in an external file.
The sequence of calls is the same as in the latter examples except that the path includes a file name.
invalid_object_error | if parent group is not valid |
link_error | if error during link-creation |
value_error | if the path contains any class-only elements |
GTYPE | group type |
target | path to the original object |
g | group where to create the link |
name | the new name of the link |
void pni::io::nx::link | ( | const pni::core::string & | target, |
const GTYPE & | g, | ||
const pni::core::string & | name | ||
) |
Creates a link to an object referenced by target. The new link is created below g with name. Here the target path is given by a string.
invalid_object_Error | if g is not a valid group |
link_error | in case of errors during link creation |
value_error | if path contains class-only elements |
GTYPE | group type |
target | path to the object as a string |
g | group where to create the link |
name | the new name of the link |
void pni::io::nx::link | ( | const char * | target, |
const GTYPE & | g, | ||
const pni::core::string & | name | ||
) |
Creates a link to an object referenced by target. The new link is created below g with name. Here the target path is given by a string.
invalid_object_error | when g is not a valid group |
link_error | in case of errors during link creation |
value_error | if path contains class-only elements |
GTYPE | group type |
target | path to the object as a string |
g | group where to create the link |
name | the new name of the link |
void pni::io::nx::link | ( | const STYPE & | target, |
const GTYPE & | g, | ||
const pni::core::string & | name | ||
) |
Create a new link to the target object. The new link will be created below g with name name. This function can currently only create internal links as it assumes that the target and g reside within the same file.
link_error | in case of errors during link creation |
invalid_object_error | if either g or target are not valid objects |
invalid_object_error | if one of the fields parents could not be retrieved or the attribute itself is not valid |
shape_mismatch_error | if a possible class attribute is not scalar |
io_error | if class data retrieval failed |
type_error | if the class attribute exists but is of the wrong type |
object_error | in case of any other error |
STYPE | type of the target object |
GTYPE | group type |
target | object to which the new link should point |
g | group where to create the link |
name | the new name of the link |
auto pni::io::nx::link_type | ( | const GTYPE< IMPID > & | parent, |
const pni::core::string & | name | ||
) | -> nxlink_type |
Returns the type of link used for child name below parent.
invalid_object_error | if parent is not a valid group |
key_error | if parent has no child with name |
link_error | if link type could not be obtained |
type_error | if the link type is unkown |
GTYPE | parent object type |
parent | instance of GTYPE |
name | of the child |
flat_group<GTYPE<IMPID> > pni::io::nx::make_flat | ( | const GTYPE< IMPID > & | group | ) |
Create a flat group from a group instance.
invalid_object_error | if the group is not valid |
object_error | in case of any other error |
type_error | if group conversion fails |
GTYPE | group type template |
IMPID | implementation ID |
group | instance of a group |
flat_group<GTYPE> pni::io::nx::make_flat | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | object | ) |
Create a flat group from an instance from nxobject.
type_error | if the parent object does not hold a group |
invalid_object_error | if the parent is not valid |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute_type |
LTYPE | link type |
object | instance of nxobject with the parent group |
bool pni::io::nx::operator!= | ( | const nxgroup< IMPID > & | a, |
const nxgroup< IMPID > & | b | ||
) |
Checks the inequality of two groups.
type_error | if the internal types could not be determined |
object_error | in case of any other error |
a | group instance on the LHS of the operator |
b | group instance on the RHS of the operator |
std::ostream & pni::io::nx::operator<< | ( | std::ostream & | stream, |
const nxlink_type & | ltype | ||
) |
Writes the textual representation of a link type enum to the output stream.
stream | output stream |
ltype | reference to a link type |
bool pni::io::nx::operator== | ( | const nxgroup< IMPID > & | a, |
const nxgroup< IMPID > & | b | ||
) |
Checks the equality of two groups.
type_error | if internal types could not be determined |
object_error | in case of any other error |
a | group instance on the LHS of the operator |
b | group instance on the RHS of the operator |