25 #include <pni/core/types.hpp>
26 #include "../nxobject.hpp"
27 #include "../nxobject_traits.hpp"
28 #include "../nximp_code_map.hpp"
29 #include "../nxfilter.hpp"
66 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
145 throw type_error(EXCEPTION_RECORD,
146 "Cannot create a field below a field!");
166 throw type_error(EXCEPTION_RECORD,
167 "Cannot create a field below an attribute!");
185 throw type_error(EXCEPTION_RECORD,
186 "Cannot create a field below a link instance!");
231 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
234 const STYPE &shape,
const STYPE &chunk,
235 const FILTERT &filter)
241 pni::core::string field_name = fpath.
back().first;
242 nxpath parent_path(fpath);
246 return boost::apply_visitor(visitor_type(field_name,shape,chunk,filter),parent);
286 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
288 const STYPE &shape,
const STYPE &chunk)
293 return create_field<T>(parent,path,shape,chunk,
filter_type());
336 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
344 return create_field<T>(parent,path,shape,chunk,filter);
378 typename STYPE = pni::core::shape_t
380 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
382 const STYPE &shape = {1})
387 return create_field<T>(parent,path,shape,chunk);
422 nxobject<GTYPE,FTYPE,ATYPE,LTYPE>
424 pni::core::type_id_t tid,ARGTS...args)
429 case type_id_t::UINT8:
return create_field<uint8>(o,args...);
430 case type_id_t::INT8:
return create_field<int8>(o,args...);
431 case type_id_t::UINT16:
return create_field<uint16>(o,args...);
432 case type_id_t::INT16:
return create_field<int16>(o,args...);
433 case type_id_t::UINT32:
return create_field<uint32>(o,args...);
434 case type_id_t::INT32:
return create_field<int32>(o,args...);
435 case type_id_t::UINT64:
return create_field<uint64>(o,args...);
436 case type_id_t::INT64:
return create_field<int64>(o,args...);
437 case type_id_t::FLOAT32:
return create_field<float32>(o,args...);
438 case type_id_t::FLOAT64:
return create_field<float64>(o,args...);
439 case type_id_t::FLOAT128:
return create_field<float128>(o,args...);
440 case type_id_t::COMPLEX32:
return create_field<complex32>(o,args...);
441 case type_id_t::COMPLEX64:
return create_field<complex64>(o,args...);
442 case type_id_t::COMPLEX128:
return create_field<complex128>(o,args...);
443 case type_id_t::BINARY:
return create_field<binary>(o,args...);
444 case type_id_t::STRING:
return create_field<string>(o,args...);
445 case type_id_t::BOOL:
return create_field<bool_t>(o,args...);
447 throw type_error(EXCEPTION_RECORD,
Filter object.
Definition: nxfilter.hpp:42
ATYPE attribute_type
Nexus attribute type.
Definition: create_field.hpp:77
nexus object traits
Definition: nxobject_traits.hpp:44
void pop_back()
remove first element from path
Definition: nxpath.cpp:126
result_type operator()(const group_type &g) const
process group instances
Definition: create_field.hpp:124
FTYPE field_type
Nexus field type.
Definition: create_field.hpp:75
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > create_field(const nxobject< GTYPE, FTYPE, ATYPE, LTYPE > &location, const PATHT &path, const STYPE &shape, const STYPE &chunk, const FILTERT &filter)
field construction
Definition: create_field.hpp:232
Definition: cbf_reader.hpp:41
create_field_visitor(const pni::core::string &n, const STYPE &s, const STYPE &cs, const filter_type &filter)
constructor
Definition: create_field.hpp:99
STYPE _cshape
chunk shape of the field
Definition: create_field.hpp:85
GTYPE group_type
Nexus group type.
Definition: create_field.hpp:73
FILTERT filter_type
define the filter type
Definition: create_field.hpp:81
auto get_object(const OTYPE &o, const PATHT &path) -> decltype(get_parent(o))
retrieve an object from path
Definition: get_object.hpp:62
STYPE _shape
shape of field
Definition: create_field.hpp:84
result_type operator()(const attribute_type &) const
process attribute instances
Definition: create_field.hpp:163
result_type operator()(const field_type &) const
process field instances
Definition: create_field.hpp:142
pni::core::string _name
the name of the field
Definition: create_field.hpp:83
Nexus path class.
Definition: nxpath/nxpath.hpp:60
filter_type _filter
reference to the filter
Definition: create_field.hpp:86
create field visitor
Definition: create_field.hpp:65
element_type back() const
get first element
Definition: nxpath.cpp:132
nxobject< GTYPE, FTYPE, ATYPE, LTYPE > result_type
result type
Definition: create_field.hpp:71
pni::core::string get_path(const OTYPE< IMPID > &o)
get object path
Definition: get_path.hpp:59
result_type operator()(const link_type &) const
process link instances
Definition: create_field.hpp:182
boost::variant< GTYPE, FTYPE, ATYPE, LTYPE > nxobject
Definition: nxobject.hpp:44
LTYPE link_type
link type
Definition: create_field.hpp:79