24 #include <pni/core/types.hpp>
25 #include "../nxobject.hpp"
54 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
83 const pni::core::string &c):
111 group = g.create_group(_name,_class);
113 group = g.create_group(_name);
117 throw value_error(EXCEPTION_RECORD,
118 "No name provided for the new group!");
140 throw type_error(EXCEPTION_RECORD,
141 "Cannot create a group below a field!");
160 throw type_error(EXCEPTION_RECORD,
161 "Cannot create a group below an attribute!");
179 throw type_error(EXCEPTION_RECORD,
180 "Cannot create a group below a link!");
225 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
237 if(parent_path.
size())
242 return boost::apply_visitor(visitor_type(e.first,e.second),parent);
ATYPE attribute_type
Nexus attribute type.
Definition: create_group.hpp:70
create group visitor
Definition: create_group.hpp:53
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
size_t size() const
return number of group entries
Definition: nxpath.cpp:138
result_type operator()(const group_type &g) const
process group instances
Definition: create_group.hpp:103
void pop_back()
remove first element from path
Definition: nxpath.cpp:126
LTYPE link_type
link type
Definition: create_group.hpp:72
result_type operator()(const field_type &) const
process field instances
Definition: create_group.hpp:136
result_type operator()(const attribute_type &) const
process attribute instances
Definition: create_group.hpp:157
Definition: cbf_reader.hpp:41
create_group_visitor(const pni::core::string &n, const pni::core::string &c)
constructor
Definition: create_group.hpp:82
result_type operator()(const link_type &) const
process link instances
Definition: create_group.hpp:176
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > result_type
result type
Definition: create_group.hpp:64
std::pair< pni::core::string, pni::core::string > element_type
object element (groupname:class)
Definition: nxpath/nxpath.hpp:64
GTYPE group_type
Nexus group type.
Definition: create_group.hpp:66
pni::core::string _name
the name of the group
Definition: create_group.hpp:59
auto get_object(const OTYPE &o, const PATHT &path) -> decltype(get_parent(o))
retrieve an object from path
Definition: get_object.hpp:62
FTYPE field_type
Nexus field type.
Definition: create_group.hpp:68
pni::core::string _class
the Nexus class of the group
Definition: create_group.hpp:61
Nexus path class.
Definition: nxpath/nxpath.hpp:60
element_type back() const
get first element
Definition: nxpath.cpp:132
pni::core::string get_path(const OTYPE< IMPID > &o)
get object path
Definition: get_path.hpp:59
boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > nxobject
Definition: nxobject.hpp:44