24 #include <pni/core/types.hpp>
25 #include <pni/core/error.hpp>
26 #include "../nxobject.hpp"
27 #include "../nxobject_traits.hpp"
55 template<nximp_code>
class PTYPE,
58 typename nxobject_trait<IMPID>::object_type
64 static_assert(std::is_same<field_type,PTYPE<IMPID>>::value ||
65 std::is_same<group_type,PTYPE<IMPID>>::value,
66 "Parent must be a field or a group!");
68 return parent.attributes[name];
92 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
173 throw type_error(EXCEPTION_RECORD,
174 "Attributes cannot have attributes by themself!");
192 throw type_error(EXCEPTION_RECORD,
193 "Instances of link do not have attribtues!");
225 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
227 const pni::core::string &name)
230 return boost::apply_visitor(visitor_type(name),parent);
result_type operator()(const attribute_type &) const
process attributes
Definition: get_attribute.hpp:170
GTYPE group_type
Nexus group type.
Definition: get_attribute.hpp:101
nexus object traits
Definition: nxobject_traits.hpp:44
get_attribute_visitor(const pni::core::string &attr)
constructor
Definition: get_attribute.hpp:116
result_type operator()(const group_type &g) const
process groups
Definition: get_attribute.hpp:133
Definition: cbf_reader.hpp:41
result_type operator()(const field_type &f) const
process fields
Definition: get_attribute.hpp:151
get attribute visitor
Definition: get_attribute.hpp:91
nxobject_trait< IMPID >::object_type get_attribute(const PTYPE< IMPID > &parent, const pni::core::string &name)
get attribute by name
Definition: get_attribute.hpp:59
ATYPE result_type
result type
Definition: get_attribute.hpp:99
ATYPE attribute_type
Nexus attribute type.
Definition: get_attribute.hpp:105
nximp_code
implementation codes
Definition: nximp_code.hpp:40
LTYPE link_type
Nexus link type.
Definition: get_attribute.hpp:107
FTYPE field_type
Nexus field type.
Definition: get_attribute.hpp:103
result_type operator()(const link_type &) const
process link instances
Definition: get_attribute.hpp:189
pni::core::string _attribute
name of the attribute to retrieve
Definition: get_attribute.hpp:96
boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > nxobject
Definition: nxobject.hpp:44