libpniio
|
![]() |
Modules | |
Internal classes used by algorithms | |
Functions | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
ATYPE | pni::io::nx::as_attribute (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
as attribute wrapper More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
FTYPE | pni::io::nx::as_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
as field wrapper More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
GTYPE | pni::io::nx::as_group (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
as group wrapper More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
LTYPE | pni::io::nx::as_link (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
as link wrapper More... | |
template<nximp_code IMPID> | |
void | pni::io::nx::close (nxlink< IMPID > &) |
close object More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
void | pni::io::nx::close (nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
close object More... | |
template<typename T , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename STYPE > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_attribute (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const pni::core::string &name, const STYPE &shape, bool overwrite=false) |
create multidimensional attribute More... | |
template<typename T , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_attribute (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const pni::core::string &name, bool overwrite=false) |
create scalar attribute More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename... ARGTS> | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_attribute (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, pni::core::type_id_t tid, ARGTS...args) |
create attribute More... | |
template<typename T , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename STYPE , typename FILTERT , typename PATHT > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &location, const PATHT &path, const STYPE &shape, const STYPE &chunk, const FILTERT &filter) |
field construction More... | |
template<typename T , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename STYPE , typename PATHT > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const PATHT &path, const STYPE &shape, const STYPE &chunk) |
field construction template More... | |
template<typename T , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename STYPE , typename PATHT , typename FILTERIMP > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const PATHT &path, const STYPE &shape, const nxfilter< FILTERIMP > &filter) |
field construction template More... | |
template<typename T , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename PATHT , typename STYPE = pni::core::shape_t> | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const PATHT &path, const STYPE &shape={1}) |
field construction template More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename... ARGTS> | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, pni::core::type_id_t tid, ARGTS...args) |
field construction template More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE , typename PATHT > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::create_group (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, const PATHT &path) |
create_group wrapper More... | |
template<template< nximp_code > class PTYPE, nximp_code IMPID> | |
nxobject_trait< IMPID > ::object_type | pni::io::nx::get_attribute (const PTYPE< IMPID > &parent, const pni::core::string &name) |
get attribute by name More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::get_attribute (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const pni::core::string &name) |
get attribute More... | |
template<typename CTYPE , template< nximp_code > class PTYPE, nximp_code IMPID> | |
CTYPE | pni::io::nx::get_attributes (const PTYPE< IMPID > &parent) |
get attributes from an object More... | |
template<typename CTYPE , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
CTYPE | pni::io::nx::get_attributes (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent) |
get attributes More... | |
template<typename OTYPE > | |
auto | pni::io::nx::get_child (const OTYPE &o, const pni::core::string &n, const pni::core::string &c="") -> decltype(get_parent(o)) |
get child by name and/or class More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
auto | pni::io::nx::get_child (const OTYPE< IMPID > &parent, size_t index) -> decltype(get_parent(parent)) |
get child by index More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
auto | pni::io::nx::get_child (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, size_t index) -> decltype(get_parent(parent)) |
get child by index More... | |
template<typename CTYPE , typename OTYPE > | |
CTYPE | pni::io::nx::get_children (const OTYPE &parent, const string &c) |
get children with a common class More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
pni::core::string | pni::io::nx::get_class (const OTYPE< IMPID > &group) |
get the class of a group More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
pni::core::string | pni::io::nx::get_class (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get group class More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
pni::core::string | pni::io::nx::get_filename (const OTYPE< IMPID > &o) |
get filename More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
pni::core::string | pni::io::nx::get_filename (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get filename More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
pni::core::string | pni::io::nx::get_name (const OTYPE< IMPID > &o) |
get object name More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
pni::core::string | pni::io::nx::get_name (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get name More... | |
template<typename OTYPE , typename PATHT > | |
auto | pni::io::nx::get_object (const OTYPE &o, const PATHT &path) -> decltype(get_parent(o)) |
retrieve an object from path More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
nxobject_trait< IMPID > ::object_type | pni::io::nx::get_parent (const OTYPE< IMPID > &o) |
return parent More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > | pni::io::nx::get_parent (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get parent More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
pni::core::string | pni::io::nx::get_path (const OTYPE< IMPID > &o) |
get object path More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
pni::core::string | pni::io::nx::get_path (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get path More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
size_t | pni::io::nx::get_rank (const OTYPE< IMPID > &o) |
get rank More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
size_t | pni::io::nx::get_rank (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get rank More... | |
template<typename OTYPE > | |
auto | pni::io::nx::get_root (const OTYPE &p) -> decltype(get_parent(p)) |
get root More... | |
template<typename CTYPE , template< nximp_code > class OTYPE, nximp_code IMPID> | |
CTYPE | pni::io::nx::get_shape (const OTYPE< IMPID > &object) |
get shape More... | |
template<typename CTYPE , typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
CTYPE | pni::io::nx::get_shape (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get shape More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
size_t | pni::io::nx::get_size (const OTYPE< IMPID > &o) |
get number of elements More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
size_t | pni::io::nx::get_size (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get size More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
pni::core::type_id_t | pni::io::nx::get_type (const OTYPE< IMPID > &o) |
get type More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
pni::core::type_id_t | pni::io::nx::get_type (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get type More... | |
template<typename FTYPE > | |
pni::core::string | pni::io::nx::get_unit (const FTYPE &field) |
get the unit of a field More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
void | pni::io::nx::grow (OTYPE< IMPID > &o, size_t dimension=0, size_t extend=1) |
grow a field More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
void | pni::io::nx::grow (nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, size_t d=0, size_t e=1) |
grow object More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
bool | pni::io::nx::is_attribute (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept |
check if attribute More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
bool | pni::io::nx::is_class (const OTYPE< IMPID > &object, const pni::core::string &type) |
checks group type More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
bool | pni::io::nx::is_class (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, const pni::core::string &c) |
is class function More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
bool | pni::io::nx::is_field (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept |
check if field More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
bool | pni::io::nx::is_group (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept |
test for group More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
bool | pni::io::nx::is_link (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept |
test for group More... | |
template<typename OTYPE > | |
bool | pni::io::nx::is_valid (const OTYPE &o) noexcept |
visitor checking object validity More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
bool | pni::io::nx::is_valid (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept |
is_valid wrapper More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
auto | pni::io::nx::begin (const OTYPE< IMPID > &group) -> decltype(group.begin()) |
get iterator to first element More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
auto | pni::io::nx::end (const OTYPE< IMPID > &group) -> decltype(group.end()) |
get iterator to last element More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
GTYPE::iterator | pni::io::nx::begin (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get iterator to first child More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
GTYPE::iterator | pni::io::nx::end (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) |
get iterator to last+1 child More... | |
template<typename OTYPE > | |
OTYPE | pni::io::nx::get_object_by_name (const OTYPE &parent, const pni::core::string &name) |
search for object by name More... | |
template<typename OTYPE > | |
OTYPE | pni::io::nx::get_object_by_name_and_class (const OTYPE &parent, const pni::core::string &name, const pni::core::string &c) |
search for object by name and class More... | |
template<typename OTYPE > | |
OTYPE | pni::io::nx::get_object_by_class (const OTYPE &parent, pni::core::string c) |
find object by class More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID, typename ATYPE > | |
void | pni::io::nx::read (const OTYPE< IMPID > &o, ATYPE &a) |
read data More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID, typename ATYPE , typename... ITYPES> | |
void | pni::io::nx::read (const OTYPE< IMPID > &o, ATYPE &a, ITYPES...indices) |
read data More... | |
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE , typename... ITYPES> | |
void | pni::io::nx::read (const nxobject< GTYPE, FTYPE, ATTYPE, LTYPE > &o, ATYPE &a, ITYPES...indices) |
read data from a field or attribute More... | |
template<typename ATYPE , typename GTYPE , typename FTYPE , typename ATTYPE , typename LTYPE > | |
void | pni::io::nx::read (const nxobject< GTYPE, FTYPE, ATTYPE, LTYPE > &o, ATYPE &a, const std::vector< pni::core::slice > &sel) |
read data from a field or attribute More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID> | |
void | pni::io::nx::set_class (const OTYPE< IMPID > &o, const pni::core::string &nxclass) |
set class for a group More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
void | pni::io::nx::set_class (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, const pni::core::string &c) |
set class More... | |
template<typename FTYPE > | |
void | pni::io::nx::set_unit (const FTYPE &field, const pni::core::string &value) |
set the unit More... | |
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE > | |
void | pni::io::nx::set_unit (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, const pni::core::string &s) |
set unit More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID, typename ATYPE > | |
void | pni::io::nx::write (const OTYPE< IMPID > &o, const ATYPE &a) |
write data to an attribute or field More... | |
template<template< nximp_code > class OTYPE, nximp_code IMPID, typename ATYPE , typename... ITYPES> | |
void | pni::io::nx::write (const OTYPE< IMPID > &o, const ATYPE &a, ITYPES...indices) |
write data to an attribute or field More... | |
template<typename ATYPE , typename GTYPE , typename FTYPE , typename AATYPE , typename LTYPE , typename... ITYPES> | |
void | pni::io::nx::write (nxobject< GTYPE, FTYPE, AATYPE, LTYPE > &&o, const ATYPE &a, ITYPES...indices) |
write wrapper More... | |
Nexus files can be considered as a heterogeneous container (a container holding instances of different types). This section describes algorithms that work on particular Nexus objects.
There are basically three kinds of algorithms
General purpose algorithms are
function name | purpose | principal input | return type |
---|---|---|---|
as_attribute | convert nxobject to nxattribute | nxobject | nxattribute |
as_field | convert nxobject to nxfield | nxobject | nxfield |
as_group | convert nxobject to nxgroup | nxobject | nxgruop |
is_attribute | true if object is an nxattribute | nxobject | bool |
is_field | true if object is an nxfield | nxobject | bool |
is_group | true if object is an nxgroup | nxobject | bool |
is_valid | true if object is valid | all | bool |
get_name | return the name of an object | all | string |
colse | close an object | all | void |
create_attribute | create an attribute | nxobject, nxfield, nxgroup | nxobject |
get_attribute | return an attribute | nxobject, nxfield, nxgruop | nxobject |
get_attributes | return attribute container | nxfield,nxgroup,nxobject | container<nxobject> |
get_parent | get parent object | all | nxobject |
get_path | get path | all | nxpath |
get_root | return root group | all | nxobject |
Group related algorithms are
function name | purpose | principal input | return type |
---|---|---|---|
get_child_by_index | return child by numeric index | nxgroup, nxobject | nxobject |
get_child | return child by name | nxgroup, nxobject | nxobject |
get_children | returns list of children | nxgroup, nxobject | container |
get_object | get object by path | nxgroup, nxobject | nxobject |
create_field | create a field | nxgroup, nxobject | nxobject |
create_group | create a group | nxgroup, nxobject | nxobject |
get_class | return a groups class | nxgroup, nxobject | string |
is_class | check if object is of a particular class | nxgroup,nxobject | bool |
set_class | set the class of an object | nxgruop, nxobject | void |
IO (nxattribute, nxfield) related algorithms
function name | purpose | principal input | return type |
---|---|---|---|
get_shape | return object shape | nxfield, nxattribute, nxobject | container |
get_size | return size of element | nxfield, nxattribute, nxobject | size_t |
get_type | get type ID of the object | nxfield, nxattribute, nxobject | type_id_t |
get_unit | return unit of data field | nxfield, nxobject | string |
set_unit | set unit for a field | nxfield, nxobject | void |
get_rank | return number of dimensions | nxfield, nxattribute, nxobject | size_t |
grow | grow a field | nxfield, nxobject | void |
read | read data from object | nxfield, nxattribute, nxobject | void |
write | write data to object | nxfield, nxattribute, nxobject | void |
ATYPE pni::io::nx::as_attribute | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Function template extracting an attribute stored in an nxobject instance. If the object is not an attribute an nxattribute_error exception will be thrown. The object is returned as an nxattribute instance.
type_error | if stored object is not a attribute type |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
o | instance of nxobject |
FTYPE pni::io::nx::as_field | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
function template extracting a field stored in an nxobject instance. If the stored object is not an instance of nxfield an exception of type nxfield_error will be thrown.
type_error | if stored object is not a field type |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
o | instance of nxobject |
GTYPE pni::io::nx::as_group | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Function template returning a group object stored in an nxobject instance. If the stored object is not an instance of nxgroup an exception will be thrown.
type_error | if stored object is not a group type |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
o | instance of nxobject<GTYPE,FTYPE,ATYPE> |
LTYPE pni::io::nx::as_link | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Function template extracting a link stored in an nxobject instance. If the object is not a link a type_error exception will be thrown. The object is returned as an nxlink instance.
type_error | if stored object is not a attribute type |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
auto pni::io::nx::begin | ( | const OTYPE< IMPID > & | group | ) | -> decltype(group.begin()) |
Returns an iterator to the first child element of a group object.
group | reference to a group instance |
GTYPE::iterator pni::io::nx::begin | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Returns an iterator to the first child attached to a group stored in an nxobject instance. If the nxobject instance does not hold a group type_error is thrown.
type_error | if the stored object is not a group |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | group object |
void pni::io::nx::close | ( | nxlink< IMPID > & | ) |
Invokes the close() method of the passed object. The objects accepted by this function template are either of type nxfield, nxattribute, nxgroup, or nxfile.
object_error | in case of errors |
type_error | if internal object type is not supported |
OTYPE | object type |
o | instance of the object to close |
void pni::io::nx::close | ( | nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Wrapper function around the close_visitor. The function closes the object stored in the variant type passed to it.
object_error | in case of an error during closing the object |
type_error | if the internal object type could not be determined |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject<GTYPE,FTYPE,ATYPE,LTYPE> |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_attribute | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
const pni::core::string & | name, | ||
const STYPE & | shape, | ||
bool | overwrite = false |
||
) |
Create an attribute of a particular name, type, and shape at a parent object. The parent is provided as an instance of nxobject.
The last argument is the shape of the attribute. If now shape is passed a scalar attribute will be created.
invalid_object_error | if the parent object is not valid |
type_error | if the data type is not supported or the parent holds an nxattribute instance |
object_error | in case of any other error |
T | data type of the attribute |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
STYPE | shape container type |
parent | instance of parent object |
name | name of the new attribute |
shape | shape of the attribute |
overwrite | if true an existing attribute will be overwritten |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_attribute | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
const pni::core::string & | name, | ||
bool | overwrite = false |
||
) |
Create an attribute of a particular name, type, and shape at a parent object. The parent is provided as an instance of nxobject.
The last argument is the shape of the attribute. If now shape is passed a scalar attribute will be created.
invalid_object_error | if the parent object is not valid |
type_error | if the data type is not supported or the parent holds an nxattribute instance |
object_error | in case of any other error |
T | data type of the attribute |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
parent | instance of the parent |
name | name of the new attribute |
overwrite | if true overwrite an existing attribute of equal name |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_attribute | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
pni::core::type_id_t | tid, | ||
ARGTS... | args | ||
) |
Create an attribute of a given name, shape, and type at a parent object. This special version of create_attribute is particularly useful in situations where the data type is provided at runtime.
The first two arguments are the parent object and the type id. All other arguments are the same as for the other create_attribute templates.
invalid_object_error | if the parent object is not valid |
type_error | if the data type is not supported or the parent holds an nxattribute instance |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
STYPE | shape container type |
o | instance of VTYPE with the parent group |
tid | type id of the attributes data type |
args | residual arguments |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_field | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | location, |
const PATHT & | path, | ||
const STYPE & | shape, | ||
const STYPE & | chunk, | ||
const FILTERT & | filter | ||
) |
The full function to construct a field relative to a particular group.
invalid_object_error | if the parent is not valid |
type_error | if the data type is not supported |
size_mismatch_error | if chunk-shape and shape do not match |
object_error | in case of any other error |
T | data type of the new array |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
STYPE | shape type |
FILTERT | filter type |
PATHT | path type |
location | the root location where the field should be created |
path | a string or nxpath object with the path to the field |
shape | the initial shape of the field |
chunk | the chunkd shape of the field |
filter | reference to the filter object |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_field | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
const PATHT & | path, | ||
const STYPE & | shape, | ||
const STYPE & | chunk | ||
) |
This template does field construction without filters
invalid_object_error | if the parent is not valid |
type_error | if the data type is not supported |
size_mismatch_error | if chunk-shape and shape do not match |
object_error | in case of any other error |
T | data type of the new field |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
STYPE | shape type |
PATHT | path type |
parent | the parent object for the field |
path | string or nxpath with the location of the field |
shape | the shape of the field |
chunk | the chunk shape for the field |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_field | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
const PATHT & | path, | ||
const STYPE & | shape, | ||
const nxfilter< FILTERIMP > & | filter | ||
) |
This template does field construction with filters. Only the primary shape of the field is given by the user. The chunk shape will be created automatically.
invalid_object_error | if the parent is not valid |
type_error | if the data type is not supported |
size_mismatch_error | if chunk-shape and shape do not match |
object_error | in case of any other error |
T | data type of the new field |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
STYPE | shape type |
PATHT | path type |
FILTERIMP | filter implementation type |
parent | the parent object for the field |
path | string or nxpath with the location of the field |
shape | the shape of the field |
filter | reference to the filter to use |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_field | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
const PATHT & | path, | ||
const STYPE & | shape = {1} |
||
) |
invalid_object_error | if the parent is not valid |
type_error | if the data type is not supported |
size_mismatch_error | if chunk-shape and shape do not match |
object_error | in case of any other error |
T | data type of the new field |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
PATHT | path type |
STYPE | shape type |
parent | the parent location for the new field |
path | string or nxpath with the relative position for the field |
shape | the shape of the new field |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_field | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
pni::core::type_id_t | tid, | ||
ARGTS... | args | ||
) |
This template function is particulary useful if the data type for the new field is available only at runtime.
invalid_object_error | if the parent is not valid |
type_error | if the data type is not supported |
size_mismatch_error | if chunk-shape and shape do not match |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
ARGTS | residual argument types |
o | parent location for the new field |
tid | the type ID for the new field |
args | residual args as for the other function templates |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::create_group | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
const PATHT & | path | ||
) |
Wrapper function for the create_group_visitor. This wrapper creates a new group of a particular name and class directly below the parent group. In order to successfully create a group at least the name argument must be non-empty. If an empty string is passed as the groups class then the NX_class attribute will not be set. The function does not create intermediate groupw which do not exist. In this case an key_error exception will be thrown.
invalid_object_error | if the parent is not valid |
key_error | if an element in the path provided by the user does not exist |
type_error | if the parent object is not a group |
object_error | in case of any other error |
value_error | if the user did not provide a name for the new group |
io_error | if metadata retrieval failed |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
PATHT | path type |
o | reference to the parent |
path | the path or name of the new group |
auto pni::io::nx::end | ( | const OTYPE< IMPID > & | group | ) | -> decltype(group.end()) |
Returns an iterator to the last+1 child of a group.
group | reference to the group instance |
GTYPE::iterator pni::io::nx::end | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Return an interator to the last+1 child attached to a group stored in an instance of nxobject or throw type_error if the nxobject instance does not hold a gruop.
type_error | if the stored object is not a group |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | the group from which we want the iterator |
nxobject_trait<IMPID>::object_type pni::io::nx::get_attribute | ( | const PTYPE< IMPID > & | parent, |
const pni::core::string & | name | ||
) |
Return an attribute from a parent object. This template will work for the following types
invalid_object_error | if parent is not valid |
key_error | if the object does not have an attribute with name |
object_error | in case of any other erro |
PTYPE | parent type template |
IMPID | parent type implementation id |
parent | refernece to parent instance |
name | attributes name |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::get_attribute | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
const pni::core::string & | name | ||
) |
Returns an attribute from an object stored in an instance of nxobject. The object must be either an nxfield or an nxgroup instance.
invalid_object_error | if the parent is not valid |
key_error | if the attribute does not exist |
type_error | if the parent is not a field or group |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
parent | reference to the parent object |
name | the attributes name |
CTYPE pni::io::nx::get_attributes | ( | const PTYPE< IMPID > & | parent | ) |
Return a container with all attributes attached to an object. The value type of the container must either be an instance of nxobject or nxattribute (otherwise a compile time assertion will be raised).
This template will retrieve the attributes from the following types
object_error | in case of any other erro |
CTYPE | container type where to store the attributes |
PTYPE | parent type template |
IMPID | parent type implementation id |
parent | reference to parent instance |
CTYPE pni::io::nx::get_attributes | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent | ) |
Return all attributes attached to an object in an instance of a ser defined container type.
invalid_object_error | if the parent is not valid |
object_error | in case of any other error |
CTYPE | container type |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
parent | reference to the parent object |
auto pni::io::nx::get_child | ( | const OTYPE & | o, |
const pni::core::string & | n, | ||
const pni::core::string & | c = "" |
||
) | -> decltype(get_parent(o)) |
Returns the child of a group which is determined by its name and/or group.
invalid_object_error | if the parent is not valid |
type_error | if the object is not an nxgroup instance or the nxobject instance does not store a group |
key_error | if an object which satisifies the requested name and class could not be found |
object_error | in case of any other error |
OTYPE | group or nxobject instance |
o | nxgroup or nxobject instance |
n | name of the child |
c | class of the object |
auto pni::io::nx::get_child | ( | const OTYPE< IMPID > & | parent, |
size_t | index | ||
) | -> decltype(get_parent(parent)) |
Get a child by its numerical index. The parent object is an instance of nxgroup.
invalid_object_error | if the parent is not valid |
index_error | if index exceeds total number of children |
type_error | if the type of a child is not supported |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID |
parent | instance of the parent object |
index | numerical index of the requested child |
auto pni::io::nx::get_child | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | parent, |
size_t | index | ||
) | -> decltype(get_parent(parent)) |
This template function takes an instance of nxobject wrapping a group as a parent. If the wrapped object is not a group a type_error exception is thrown.
invalid_object_error | if the parent is not valid |
index_error | if the index exceeds the total number of children |
type_error | if the parent is not a group or the child type is not supported |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
parent | instance of nxobject with the parent group |
index | the numerical index of the requested child |
CTYPE pni::io::nx::get_children | ( | const OTYPE & | parent, |
const string & | c | ||
) |
Returns all children of a parent group which share a common class type. The results will be stored in a container type provided by the user as a template paremeter. It is important to note that the only parameter we can search for here is the base class type. As we are searching only within a single parent all names must be distinct. Unlike the get_cild
function template this template does not throw if no object matches the class type. Instead, an empty container is returned.
invalid_object_error | if the parent is not valid |
type_error | if the object is not an nxgroup instance or the nxobject instance does not store a group |
object_error | in case of any other error |
CTYPE | container type to hold the results |
OTYPE | group or nxobject instance |
o | nxgroup or nxobject instance |
c | class of the object |
pni::core::string pni::io::nx::get_class | ( | const OTYPE< IMPID > & | group | ) |
This function template returns the class of a group which is stored in its NX_class attribute.
invalid_object_error | if parent group is not valid |
shape_mismatch_error | the attribute is not a scalar |
type_error | the attribute type is not supported |
io_error | attribute data retrieval failed |
object_error | in case of any other error |
IMPID | implementation ID for the group |
group | the group for which the class should be obtained |
pni::core::string pni::io::nx::get_class | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Return the class of a group.
type_error | if the passed object is not a group |
invalid_object_error | if the passed object is not valid |
shape_mismatch_error | if NX_class attribute is not a scalar |
io_error | if attribute data could not be retrieved |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | group as instance of nxobject |
pni::core::string pni::io::nx::get_filename | ( | const OTYPE< IMPID > & | o | ) |
Return the filename an object belongs to. This template works for instances of
invalid_object_error | in case of an invalid object |
io_error | if filename cannot be retrieved |
type_error | if the implementation type does not support filename retrieval |
object_error | in case of any other error |
OTYPE | object type template |
IMPID | implementation ID |
o | reference to the object |
pni::core::string pni::io::nx::get_filename | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Get the name of the file where a particular object is stored.
invalid_oject_error | if the object is not valid |
io_error | if filename retrieval fails |
type_error | if the implementation type does not support filename retrieval |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
pni::core::string pni::io::nx::get_name | ( | const OTYPE< IMPID > & | o | ) |
Return the name of an object. This template function is called in case that the object is an instance of
io_error | in case of problems |
invalid_object_erro | in case of an invalid object |
type_error | if a type cannot be retrieved for this type |
object_error | in case of any other error |
OTYPE | object type template |
IMPID | implementation ID |
o | reference to the object |
pni::core::string pni::io::nx::get_name | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Retriev the name of an object stored in an instance of the nxobject template.
io_error | in case of IO errors |
invalid_oject_error | if the object is not valid |
type_error | if a type cannot be retrieved for this type |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
auto pni::io::nx::get_object | ( | const OTYPE & | o, |
const PATHT & | path | ||
) | -> decltype(get_parent(o)) |
Retrieve an object whose position is determined by a nexus path. The path can be either relative or absolute. In the former case the path is relative to the parent object. In the latter on the parent object is only used to retrieve the root group and then continue from there.
invalid_object_error | if the parent is not valid |
type_error | if the object is not a group |
key_error | if one of the path element does not lead to a child |
object_error | in the case of any other error |
OTYPE | parent object type |
IMPID | implementation ID of the parent tyep |
o | reference to the parent |
path | reference to the path |
OTYPE pni::io::nx::get_object_by_class | ( | const OTYPE & | parent, |
pni::core::string | c | ||
) |
OTYPE pni::io::nx::get_object_by_name | ( | const OTYPE & | parent, |
const pni::core::string & | name | ||
) |
Search for an object stored below its parent by name. The parent must be an instance of nxgroup or nxobject wrapping a group instance. IF the object could not be found a key_error exception is thrown.
key_error | if no object with the requested name exists |
invalid_object_error | if the parent is not a valid object |
io_error | in case of errors during object meta data retrieval |
object_error | in case of any object construction or destruction problem |
parent | the parent object |
name | the name of the requested object |
OTYPE pni::io::nx::get_object_by_name_and_class | ( | const OTYPE & | parent, |
const pni::core::string & | name, | ||
const pni::core::string & | c | ||
) |
This function searches for an object by its name and class. Obviously such an object can only be a group as fields do not have a class attribute.
The function first tries to find an object with a matching name. If it finds such an object it checks if it is a group and throws a type_error exception if it is not. In the case of a group the function continues to check if the group type matches.
invalid_object_error | if the parent object is not valid |
io_error | in case of errors during retrieving object metadata |
type_error | if the object found by name is not a group |
key_error | if no object of the requested name and class could be found |
object_error | in any case of errors during object creation, destruction, or copying |
OTYPE | object type |
parent | the parent object |
name | the name of the requested group |
c | the class of the requested group |
nxobject_trait<IMPID>::object_type pni::io::nx::get_parent | ( | const OTYPE< IMPID > & | o | ) |
Returns the parent object of an instance of nxfield, nxattribute, or nxgroup object. The parent is returned as an instance of nxobject.
invalid_object_error | if the child is not valid |
type_error | if there are some issues with the internal type |
object_error | in case of errors generating parent object |
OTYPE | object template |
IMPID | implementation ID |
o | object instance |
nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::get_parent | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Return the parent object of an instance of nxobject as a new instance of nxobject.
invalid_object_error | if the object is not valid |
type_error | in case of internal type issues |
object_error | in case of errors generating parent object |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
pni::core::string pni::io::nx::get_path | ( | const OTYPE< IMPID > & | o | ) |
Return the path of an object as a string. The object can be either an instance of nxfield, nxgroup, or nxattribute.
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 |
OTYPE | object type template |
IMPID | implementation ID |
o | object instance |
pni::core::string pni::io::nx::get_path | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Return the path of an object stored in an nxobject instance.
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 |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
size_t pni::io::nx::get_rank | ( | const OTYPE< IMPID > & | o | ) |
Return the number of dimensions of an attribute or field.
invalid_object_error | if object is not valid |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID of the object |
o | reference to the field or attribute |
size_t pni::io::nx::get_rank | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Return the number of dimensions of a field or attribute wrapped in an instance of nxobject.
invalid_object_error | if object is not valid |
type_error | if the wrapped object is a group |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | object instance |
auto pni::io::nx::get_root | ( | const OTYPE & | p | ) | -> decltype(get_parent(p)) |
Return the root group of an object.
invalid_object_error | if the object is not valid |
type_error | if the implementation does not support this operation |
io_error | in the case that name retrieval fails |
object_error | in case of any other error |
OTYPE | object type |
p | reference an instance of OTYPE |
CTYPE pni::io::nx::get_shape | ( | const OTYPE< IMPID > & | object | ) |
Returns the shape of an attribute or field type. In the case of any other type compilation fails due to an internal static_assert statement. The container type used to retrieve the shape information must be provided by the user as a template parameter.
invalid_object_error | if the object is not valid |
object_error | in case of any other error |
CTYPE | container type for the shape |
OTYPE | object template |
IMPID | implementation ID |
object | the object for which the shape should be determined |
CTYPE pni::io::nx::get_shape | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Returns the shape of an attribute or field type. In the case of any other type compilation fails due to an internal static_assert statement. The container type used to retrieve the shape information must be provided by the user as a template parameter.
invalid_object_error | if the object is not valid |
object_error | in case of any other error |
CTYPE | container type for the shape |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of VTYPE |
size_t pni::io::nx::get_size | ( | const OTYPE< IMPID > & | o | ) |
Return the number of elements stored in a group, field, or attribute. In the case of a group this function template returns the number of children the group has. In the case of fields and attributes the number of elements are stored in the particular instance.
This template function works for
invalid_object_error | if the object is not valid |
object_error | in case of any other error |
OTYPE | object template |
IPMID | implementation ID argument of the object template |
o | reference to the group, field, or attribute object |
size_t pni::io::nx::get_size | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Return the number of elements stored in a group, field, or attribute. In the case of a group this function template returns the number of children the group has. In the case of fields and attributes the number of elements are stored in the particular instance.
invalid_object_error | if object is not valid |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
pni::core::type_id_t pni::io::nx::get_type | ( | const OTYPE< IMPID > & | o | ) |
Get the type ID of a field or attribute. If the type of the object is not an attribute or field type compilation will fails due to an static_insert within the template.
invalid_object_error | if the object is not valid |
type_error | if the data type used is not suppported |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID |
o | object reference |
pni::core::type_id_t pni::io::nx::get_type | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o | ) |
Get the type ID of a field or attribute.
invalid_object_error | if the object is not valid |
type_error | if the data type is not supported or the object is a group |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute_type |
LTYPE | link type |
o | object wrapped into nxobject |
pni::core::string pni::io::nx::get_unit | ( | const FTYPE & | field | ) |
Return the unit string of a field. This function works only for field types as attributes cannot store unit information.
invalid_object_error | if the field is not valid |
shape_mismatch_error | if the unit attribute is not scalar |
io_error | if reading the attribute failed |
type_error | if the type used for the units attribute is not supported |
object_error | in case of any other error |
field | instance of the Nexus field |
void pni::io::nx::grow | ( | OTYPE< IMPID > & | o, |
size_t | dimension = 0 , |
||
size_t | extend = 1 |
||
) |
invalid_object_error | if the field is not active |
index_error | if dimension exceeds the rank |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID of the object |
o | the object to grow |
dimension | index of the dimension which to extend |
extend | number of elements by which to extend |
void pni::io::nx::grow | ( | nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
size_t | d = 0 , |
||
size_t | e = 1 |
||
) |
invalid_object_error | if the field is not active |
index_error | if dimension exceeds the rank |
type_error | if the wrapped object is a group or attribute |
object_error | in the case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
d | dimension along which to grow |
e | extent by which to grow along d |
|
noexcept |
Function template checking if the object stored in an nxobject instance is an instance of nxattribute. If this is the case true is returned, otherwise false. The function does not test for the validity of an object. It just provides runtime information about the type of the object stored in the nxobject instance.
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | reference to an instance of nxobject<GTYPE,FTYPE,ATYPE> |
bool pni::io::nx::is_class | ( | const OTYPE< IMPID > & | object, |
const pni::core::string & | type | ||
) |
This function template checks whether or not a group is of a particular type.
invalid_object_error | if parent group is not valid |
shape_mismatch_error | the attribute is not a scalar |
type_error | the attribute type is not supported |
io_error | attribute data retrieval failed |
object_error | in case of any other error |
OTYPE | nexus object template |
IMPID | implementation ID of the object |
object | the group to check |
type | the type we want ot check for |
bool pni::io::nx::is_class | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
const pni::core::string & | c | ||
) |
Returns true if a group stored in an instance of nxobject is member of a particular class.
invalid_object_error | if parent group is not valid |
shape_mismatch_error | the attribute is not a scalar |
type_error | the attribute type is not supported |
io_error | attribute data retrieval failed |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject |
c | Nexus class to check for |
|
noexcept |
Function template testing if the object stored in an instance of nxobject is an instance of nxfield. If this is the case true is returned, false otherwise. The function does not test for validity of an object. It just helps to retrieve type information at runtime.
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of nxobject<GTYPE,FTYPE,ATYPE,LTYPE> |
|
noexcept |
Template function testing if the object stored in an instance of nxobject is an instance of nxgroup. If this is the case true is returned, false otherwise. The function does not test for the validity of the stored object. It just provides type information about the stored object at runtime.
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | reference to nxobject<GTYPE,FTYPE,ATYPE,LTYPE> |
|
noexcept |
Template function testing if the object stored in an instance of nxobject is an instance of nxlink. If this is the case true is returned, false otherwise. The function does not test for the validity of the stored object. It just provides type information about the stored object at runtime.
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | reference to nxobject<GTYPE,FTYPE,ATYPE,LTYPE> |
|
noexcept |
Check if the passed object is valid and return true if this is the case. This template code takes instances
as input arguments.
object_error | if the validity check fails |
OTYPE | object type |
o | instance of OTYPE |
|
noexcept |
Test the validity of an object stored in an nxobject instance by calling the is_valid method on the particular instance.
object_error | if validity check fails |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | reference to nxobject<GTYPE,FTYPE,ATYPE,LTYPE> |
void pni::io::nx::read | ( | const OTYPE< IMPID > & | o, |
ATYPE & | a | ||
) |
Read data form an attribute or field type instance. This function tempalte reads the entire content of the field or attribute. The exceptions which are thrown here depend on ATYPE.
invalid_object_error | if the field is not valid |
io_error | if reading the data fails |
type_error | if the data type of ATYPE is not supported |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID for the object |
ATYPE | array type where to store the data |
o | field or attribute instance |
a | container instance |
void pni::io::nx::read | ( | const OTYPE< IMPID > & | o, |
ATYPE & | a, | ||
ITYPES... | indices | ||
) |
Read data form an attribute or field type instance. This function allows reading only a part of the field by passing a multiindex selection to the function. The exceptions which are thrown here depend on ATYPE.
shape_mismatch_error | if selection and field rank do not match |
invalid_object_error | if the field is not valid |
io_error | if reading the data fails |
type_error | if the data type of ATYPE is not supported |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID for the object |
ATYPE | array type where to store the data |
ITYPES | index types |
o | field or attribute instance |
a | container instance |
indices | selection indices passed as variadic arguments |
void pni::io::nx::read | ( | const nxobject< GTYPE, FTYPE, ATTYPE, LTYPE > & | o, |
ATYPE & | a, | ||
ITYPES... | indices | ||
) |
This function template is a wrapper for the read_visitor. It will read data from the field or attribute stored in the variant type. Partial IO is supported only for fields. As data cannot be read from a group an exception will be thrown if the object stored in the variant type is a group object.
shape_mismatch_error | if selection and field rank do not match |
invalid_object_error | if the field is not valid |
io_error | if reading the data fails |
type_error | if the data type of ATYPE is not supported |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
ATYPE | target type for the read |
GTYPE | group type |
FTYPE | field type |
ATTYPE | attribute type |
LTYPE | link type |
ITPYES | index types |
o | instance of VTYPE |
a | instance of ATYPE with the data |
indices | index type instances |
void pni::io::nx::read | ( | const nxobject< GTYPE, FTYPE, ATTYPE, LTYPE > & | o, |
ATYPE & | a, | ||
const std::vector< pni::core::slice > & | sel | ||
) |
This function template is a wrapper for the read_visitor. It will read data from the field or attribute stored in the variant type. Partial IO is supported only for fields. As data cannot be read from a group an exception will be thrown if the object stored in the variant
shape_mismatch_error | if selection and field rank do not match |
invalid_object_error | if the field is not valid |
io_error | if reading the data fails |
type_error | if the data type of ATYPE is not supported or the object passed by the user holds a group instance |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
ATYPE | target type for the read |
GTYPE | group type |
FTYPE | field type |
ATTYPE | attribute type |
LTYPE | link type |
ITPYES | index types |
o | instance of VTYPE |
a | instance of ATYPE with the data |
sel | selection from which to read |
void pni::io::nx::set_class | ( | const OTYPE< IMPID > & | o, |
const pni::core::string & | nxclass | ||
) |
Sets the NX_class attribute at a group to a particular value.
type_error | if o is not a group |
invalid_object_error | if the group is not valid |
type_error | if the data type is not supported |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID of the object |
o | group instance for which to set NX_class |
nxclass | the value of NX_class |
void pni::io::nx::set_class | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
const pni::core::string & | c | ||
) |
Set the NX_class attribute for a group stored in an instance of nxobject.
type_error | if o is not a group |
invalid_object_error | if the group is not valid |
type_error | if the data type is not supported |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | group as instance of nxobject |
c | Nexus class as string |
void pni::io::nx::set_unit | ( | const FTYPE & | field, |
const pni::core::string & | value | ||
) |
Set the unit for a field. The unit is stored in an attribute with name "units" of data type string. The attribute is scalar.
invalid_object_error | if field is not valid |
type_error | if data type is not supported |
io_error | if writing of the value fails |
object_error | in case of any other error |
FTYPE | field type |
field | instance of the field |
value | the value for the units attribute |
void pni::io::nx::set_unit | ( | const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > & | o, |
const pni::core::string & | s | ||
) |
Set the unit for a field. The unit is stored in an attribute with name "units" of data type string. The attribute is scalar.
invalid_object_error | if field is not valid |
type_error | if data type is not supported |
io_error | if writing of the value fails |
object_error | in case of any other error |
GTYPE | group type |
FTYPE | field type |
ATYPE | attribute type |
LTYPE | link type |
o | instance of the parent object |
s | content of the unit string |
void pni::io::nx::write | ( | const OTYPE< IMPID > & | o, |
const ATYPE & | a | ||
) |
This function writes the entire data from a field.
invalid_object_error | if the field is not valid |
io_error | if writing the data fails |
type_error | if the data type of ATYPE is not supported |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID of the object |
ATYPE | storage type where the data is stored |
o | object instance to which to write the data |
a | instance from which to write the data |
void pni::io::nx::write | ( | const OTYPE< IMPID > & | o, |
const ATYPE & | a, | ||
ITYPES... | indices | ||
) |
This function writes the entire data from a field.
shape_mismatch_error | if selection and field rank do not match |
invalid_object_error | if the field is not valid |
io_error | if reading the data fails |
type_error | if the data type of ATYPE is not supported |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
OTYPE | object template |
IMPID | implementation ID of the object |
ATYPE | storage type where the data is stored |
ITYPES | index types |
o | object instance to which to write the data |
a | instance from which to write the data |
indices | selection indices passed as variadic arguments |
void pni::io::nx::write | ( | nxobject< GTYPE, FTYPE, AATYPE, LTYPE > && | o, |
const ATYPE & | a, | ||
ITYPES... | indices | ||
) |
This function template is a wrapper for the write_visitor. It will write data to the field or attribute stored in the variant type. Partial IO is supported only for fields. As data cannot be written to a group an exception will be thrown if the object stored in the variant type is a group object.
shape_mismatch_error | if selection and field rank do not match |
invalid_object_error | if the field is not valid |
io_error | if writing the data fails |
type_error | if the data type of ATYPE is not supported |
memory_not_allocated_error | if ATYPE is an array type and its internal buffer has no memory associated with it |
size_mismatch_error | if the number of elements of ATYPE and the field do not match |
object_error | in case of any other error |
ATYPE | data holding type |
VTYPE | variant type |
ITPYES | index types |
o | instance of VTYPE |
a | instance of ATYPE with the data |
indices | index type instances |