26 #include <pni/core/types.hpp>
28 #include "../algorithms/create_attribute.hpp"
29 #include "../algorithms/get_type.hpp"
30 #include "../algorithms/get_name.hpp"
31 #include "../algorithms/get_shape.hpp"
32 #include "../algorithms/get_size.hpp"
33 #include "../nxobject.hpp"
76 const node &attr_node)
106 attr_node.put(
"<xmlattr>.name",
get_name(attr));
107 attr_node.put(
"<xmlattr>.type",pni::core::str_from_type_id(
get_type(attr)));
113 auto shape = get_shape<pni::core::shape_t>(attr);
114 attr_node.add_child(
"dimensions",
size_t get_size(const OTYPE< IMPID > &o)
get number of elements
Definition: get_size.hpp:61
pni::core::string get_name(const node &n)
get name of a node
Definition: node.cpp:138
static pni::core::type_id_t type_id(const node &io_node)
get type id
Definition: io_node.cpp:72
Definition: cbf_reader.hpp:41
boost::property_tree::ptree node
alias for ptree
Definition: node.hpp:39
static nxobject< GTYPE, FTYPE, ATYPE, LTYPE > object_from_xml(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const node &attr_node)
create attribute from XML description
Definition: attribute.hpp:75
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > create_attribute(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const pni::core::string &name, const STYPE &shape, bool overwrite=false)
create multidimensional attribute
Definition: create_attribute.hpp:215
static node object_to_xml(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &attr)
write attribute to XML
Definition: attribute.hpp:101
static node object_to_xml(const pni::core::shape_t &s)
create dimension node
Definition: dimensions.cpp:105
static pni::core::string name(const node &io_node)
return object name
Definition: io_node.cpp:54
read and write attributes
Definition: attribute.hpp:48
pni::core::type_id_t get_type(const OTYPE< IMPID > &o)
get type
Definition: get_type.hpp:55
boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > nxobject
Definition: nxobject.hpp:44
static pni::core::shape_t shape(const node &io_node)
return object shape
Definition: io_node.cpp:61
general IO objects
Definition: io_node.hpp:43