24 #include "../nxobject.hpp"
53 template<
typename OTYPE>
60 if(!group.has_child(name))
61 throw key_error(EXCEPTION_RECORD,
62 "Group has no child ["+name+
"]!");
95 template<
typename OTYPE>
97 const pni::core::string &name,
98 const pni::core::string &c)
104 throw type_error(EXCEPTION_RECORD,
105 "Object is a field and thus does not have a class!");
108 throw key_error(EXCEPTION_RECORD,
109 "No object ["+name+
":"+c+
"] found!");
120 template<
typename OTYPE>
125 auto iter = std::find_if(
begin(parent),
end(parent),
126 [&c](
const OTYPE &o) {
132 if(iter ==
end(parent))
133 throw key_error(EXCEPTION_RECORD,
134 "No group of class ["+c+
"] found!");
bool is_field(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o) noexcept
check if field
Definition: is_field.hpp:135
OTYPE get_object_by_name(const OTYPE &parent, const pni::core::string &name)
search for object by name
Definition: object_predicates.hpp:54
Definition: cbf_reader.hpp:41
auto begin(const OTYPE< IMPID > &group) -> decltype(group.begin())
get iterator to first element
Definition: iterators.hpp:46
auto end(const OTYPE< IMPID > &group) -> decltype(group.end())
get iterator to last element
Definition: iterators.hpp:69
OTYPE get_object_by_class(const OTYPE &parent, pni::core::string c)
find object by class
Definition: object_predicates.hpp:121
GTYPE as_group(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &o)
as group wrapper
Definition: as_group.hpp:167
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_class(const OTYPE< IMPID > &object, const pni::core::string &type)
checks group type
Definition: is_class.hpp:58