24 #include "../nximp_code.hpp"
25 #include "../nxobject.hpp"
58 template<
typename OTYPE>
59 auto get_child(
const OTYPE &o,
const pni::core::string &n,
60 const pni::core::string &c=
"")
66 object_type object(o);
68 throw type_error(EXCEPTION_RECORD,
"Function expects a group!");
82 throw value_error(EXCEPTION_RECORD,
83 "get_child() requires a name or a class for the search!");
108 template<nximp_code>
class OTYPE,
116 static_assert(std::is_same<group_type,OTYPE<IMPID>>::value,
117 "Parent type must be an instance of nxgroup!");
119 return parent.at(index);
158 throw type_error(EXCEPTION_RECORD,
"Parent must be a group");
OTYPE get_object_by_name(const OTYPE &parent, const pni::core::string &name)
search for object by name
Definition: object_predicates.hpp:54
nexus object traits
Definition: nxobject_traits.hpp:44
Definition: cbf_reader.hpp:41
nximp_code
implementation codes
Definition: nximp_code.hpp:40
auto get_child(const OTYPE &o, const pni::core::string &n, const pni::core::string &c="") -> decltype(get_parent(o))
get child by name and/or class
Definition: get_child.hpp:59
OTYPE get_object_by_class(const OTYPE &parent, pni::core::string c)
find object by class
Definition: object_predicates.hpp:121
nxobject_trait< IMPID >::object_type get_parent(const OTYPE< IMPID > &o)
return parent
Definition: get_parent.hpp:53
GTYPE as_group(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o)
as group wrapper
Definition: as_group.hpp:167
boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > nxobject
Definition: nxobject.hpp:44
OTYPE get_object_by_name_and_class(const OTYPE &parent, const pni::core::string &name, const pni::core::string &c)
search for object by name and class
Definition: object_predicates.hpp:96
bool is_group(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept
test for group
Definition: is_group.hpp:136