25 #include <pni/core/types.hpp>
26 #include <pni/core/error.hpp>
27 #include "../algorithms/write.hpp"
28 #include "../algorithms/get_type.hpp"
29 #include "../nxobject.hpp"
30 #include "../nxobject_traits.hpp"
31 #include "../../exceptions.hpp"
32 #include "../../parsers.hpp"
79 typedef std::vector<T> buffer_type;
81 auto buffer = io_node::data_from_xml<buffer_type>(n);
111 template<
typename OTYPE>
118 case type_id_t::UINT8:
119 write_node_data<uint8>(object,n);
break;
120 case type_id_t::INT8:
121 write_node_data<int8>(object,n);
break;
122 case type_id_t::UINT16:
123 write_node_data<uint16>(object,n);
break;
124 case type_id_t::INT16:
125 write_node_data<int16>(object,n);
break;
126 case type_id_t::UINT32:
127 write_node_data<uint32>(object,n);
break;
128 case type_id_t::INT32:
129 write_node_data<int32>(object,n);
break;
130 case type_id_t::UINT64:
131 write_node_data<uint64>(object,n);
break;
132 case type_id_t::INT64:
133 write_node_data<int64>(object,n);
break;
134 case type_id_t::FLOAT32:
135 write_node_data<float32>(object,n);
break;
136 case type_id_t::FLOAT64:
137 write_node_data<float64>(object,n);
break;
138 case type_id_t::FLOAT128:
139 write_node_data<float128>(object,n);
break;
140 case type_id_t::COMPLEX32:
141 write_node_data<complex32>(object,n);
break;
142 case type_id_t::COMPLEX64:
143 write_node_data<complex64>(object,n);
break;
144 case type_id_t::COMPLEX128:
145 write_node_data<complex128>(object,n);
break;
146 case type_id_t::BOOL:
147 write_node_data<bool_t>(object,n);
break;
148 case type_id_t::STRING:
151 write(
object,io_node::data_from_xml<string>(n));
155 throw type_error(EXCEPTION_RECORD,
156 "Unrecognized data type!");
198 if(child.first ==
"group")
205 else if(child.first ==
"field")
216 else if(child.first ==
"link")
220 else if(child.first ==
"attribute")
289 template<pni::io::nx::nximp_code>
class OTYPE,
296 object_type o = group;
325 template<pni::io::nx::nximp_code>
class OTYPE,
nexus object traits
Definition: nxobject_traits.hpp:44
read and write groups
Definition: group.hpp:45
void xml_to_nexus(const node &t, const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, PTYPE write_data)
create objects from XML
Definition: xml_to_nexus.hpp:192
static nxobject< GTYPE, FTYPE, ATYPE, LTYPE > object_from_xml(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const node &group_node)
create group from XML
Definition: group.hpp:76
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
default data predicate
Definition: default.hpp:39
nximp_code
implementation codes
Definition: nximp_code.hpp:40
static pni::core::string read(const node &n)
read data from node
Definition: data_node.cpp:34
static nxobject< GTYPE, FTYPE, ATYPE, LTYPE > object_from_xml(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const node &field_node)
create field from XML
Definition: field.hpp:121
static void object_from_xml(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &parent, const node &link_node)
generate HDF5 link
Definition: xml/link.hpp:113
void write_node_data(const OTYPE &object, const node &n)
write data from buffer
Definition: xml_to_nexus.hpp:77
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
void write(const OTYPE< IMPID > &o, const ATYPE &a)
write data to an attribute or field
Definition: write.hpp:61