libpniio
nxobject_traits.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2011 DESY, Eugen Wintersberger <eugen.wintersberger@desy.de>
3 //
4 // This file is part of libpniio.
5 //
6 // libpniio is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // libpniio is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with libpniio. If not, see <http://www.gnu.org/licenses/>.
18 // ===========================================================================
19 //
20 // Created on: Jun 28, 2013
21 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
22 //
23 #pragma once
24 
25 #include <boost/variant.hpp>
26 #include <boost/mpl/at.hpp>
27 #include <boost/mpl/int.hpp>
28 #include "nximp_code.hpp"
29 #include "nximp_code_map.hpp"
30 
31 namespace pni{
32 namespace io{
33 namespace nx{
34 
35 
44  template<nximp_code id> struct nxobject_trait;
45 
46 
47  template<typename VTYPE,int i>
48  using nxobject_element = boost::mpl::at<typename VTYPE::types,boost::mpl::int_<i>>;
49 
50  //-------------------------------------------------------------------------
58  template<typename VTYPE> struct nxobject_group
59  {
62  };
63 
64  //-------------------------------------------------------------------------
72  template<typename VTYPE> struct nxobject_field
73  {
76  };
77 
78  //-------------------------------------------------------------------------
86  template<typename VTYPE> struct nxobject_attribute
87  {
90  };
91 
92 }
93 }
94 }
95 
96 
97 
98 
nxobject_element< VTYPE, 1 >::type type
field type
Definition: nxobject_traits.hpp:75
nexus object traits
Definition: nxobject_traits.hpp:44
Definition: cbf_reader.hpp:41
get attribute type
Definition: nxobject_traits.hpp:86
nxobject_element< VTYPE, 0 >::type type
group type
Definition: nxobject_traits.hpp:61
boost::mpl::at< typename VTYPE::types, boost::mpl::int_< i >> nxobject_element
Definition: nxobject_traits.hpp:48
nxobject_element< VTYPE, 2 >::type type
attribute type
Definition: nxobject_traits.hpp:89
get field type
Definition: nxobject_traits.hpp:72
get group type
Definition: nxobject_traits.hpp:58