25 #include <pni/core/types.hpp>
27 #include "../nxobject.hpp"
28 #include "../algorithms/create_field.hpp"
29 #include "../algorithms/create_group.hpp"
30 #include "../algorithms/get_name.hpp"
31 #include "../algorithms/get_class.hpp"
32 #include "../algorithms/set_class.hpp"
77 const node &group_node)
85 throw value_error(EXCEPTION_RECORD,
86 "XML group does not provide a name!");
92 if(name ==
"/" &&
get_name(parent) ==
"/")
139 group_node.put(
"<xmlattr>.name",
get_name(group));
141 pni::core::string gclass =
get_class(group);
143 group_node.put(
"<xmlattr>.type",gclass);
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > create_group(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o, const PATHT &path)
create_group wrapper
Definition: create_group.hpp:226
bool has_attribute(const node &parent, const pni::core::string &name)
check for attribute existence
read and write groups
Definition: group.hpp:45
pni::core::string get_name(const node &n)
get name of a node
Definition: node.cpp:138
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
void set_class(const OTYPE< IMPID > &o, const pni::core::string &nxclass)
set class for a group
Definition: set_class.hpp:54
boost::property_tree::ptree node
alias for ptree
Definition: node.hpp:39
static pni::core::string read(const node &n)
read data from node
Definition: data_node.cpp:34
pni::core::string get_class(const OTYPE< IMPID > &group)
get the class of a group
Definition: get_class.hpp:56
node get_attribute(const node &parent, const pni::core::string &name)
get attribute node
boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > nxobject
Definition: nxobject.hpp:44
static node object_to_xml(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &group)
write group to XML
Definition: group.hpp:134