libpniio
Static Public Member Functions
pni::io::nx::xml::field Struct Reference

read and write field data

#include <field.hpp>

Inheritance diagram for pni::io::nx::xml::field:
Inheritance graph
[legend]
Collaboration diagram for pni::io::nx::xml::field:
Collaboration graph
[legend]

Static Public Member Functions

static pni::core::string unit (const node &field_node)
 return field unit More...
 
static pni::core::string long_name (const node &field_node)
 return long name More...
 
static pni::core::shape_t chunk (const node &field_node)
 get chunk shape More...
 
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE >
static nxobject< GTYPE, FTYPE,
ATYPE, LTYPE > 
object_from_xml (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const node &field_node)
 create field from XML More...
 
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE >
static node object_to_xml (const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &f)
 create XML object from field More...
 
- Static Public Member Functions inherited from pni::io::nx::xml::io_node
static size_t size (const node &io_node)
 return object size More...
 
static size_t rank (const node &io_node)
 return object rank More...
 
static pni::core::string name (const node &io_node)
 return object name More...
 
static pni::core::shape_t shape (const node &io_node)
 return object shape More...
 
static pni::core::type_id_t type_id (const node &io_node)
 get type id More...
 
template<typename T >
static T data_from_xml (const node &io_node)
 get data from XML More...
 
template<typename T >
static void data_to_xml (node &io_node, const T &value)
 write data to XML More...
 

Member Function Documentation

shape_t pni::io::nx::xml::field::chunk ( const node field_node)
static

Retrieve the chunk shape from the field tag. If the field has no chunk tag an empty shape_t instance will be returned.

Exceptions
parser_errorin case of an error field_node the XML node with the field specification
Returns
an instance of shape_t with the chunk shape
string pni::io::nx::xml::field::long_name ( const node field_node)
static

Obtain the long name from the XML node.

Exceptions
parser_errorin case of an error
Parameters
field_nodethe XML node with the field information
Returns
string with long name information
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE >
static nxobject<GTYPE,FTYPE,ATYPE,LTYPE> pni::io::nx::xml::field::object_from_xml ( const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &  parent,
const node field_node 
)
inlinestatic

Creates a new field object below parent according to the information stored in the actual XML node. The data stored in the XML node is not copied to the field automatically.

Exceptions
parser_errorif XML parsing operations fail
invalid_object_errorif the parent is not valid
type_errorif the data type is not supported
io_errorif metadata cannot be written
object_errorin case of any other error
shape_mismatch_errorif chunk and dimensions tag rank do not match
Template Parameters
GTYPEgroup type
Parameters
parentthe parent group for the new field
field_nodeXML node with field information
Returns
field instance
template<typename GTYPE , typename FTYPE , typename ATYPE , typename LTYPE >
static node pni::io::nx::xml::field::object_to_xml ( const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &  f)
inlinestatic

Create an XML object from a field. No data is included in the XML output. But it could easily be added with the data_to_xml function. No data is copied from the field instance to the XML node.

Exceptions
parser_errorin case of IO errors on the XML side
invalid_object_errorif the field is not valid
io_errorin case of metadata retrieval fails
type_errorif data type of the field cannot be handled
object_errorin case of any other error
Template Parameters
FTYPEfield type
Parameters
fieldreference to the field instance
Returns
XML node object with field information
string pni::io::nx::xml::field::unit ( const node field_node)
static
Exceptions
parser_errorin case of an error
Parameters
field_nodeXML node with field information
Returns
string with the unit

The documentation for this struct was generated from the following files: