libpniio
primitive_generators.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2015 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: Apr 27, 2015
21 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
22 //
23 //
24 #pragma once
25 
26 #include <pni/core/types.hpp>
27 #include <boost/spirit/include/karma.hpp>
28 #include <boost/mpl/map.hpp>
29 
30 #include "float_policy.hpp"
31 #include "complex_generator.hpp"
32 
33 namespace pni{
34 namespace io{
35 
36  //
37  // First we need a unified template interface for all generator templates.
38  // The first template argument should be the interator and the second
39  // the attribute type.
40  //
41  template<typename ITERT,typename T>
42  using pni_io_uint_generator = boost::spirit::karma::uint_generator<T>;
43 
44  template<typename ITERT,typename T>
45  using pni_io_int_generator = boost::spirit::karma::int_generator<T>;
46 
47  template<typename ITERT,typename T>
48  using pni_io_real_generator = boost::spirit::karma::real_generator<T,float_policy<T>>;
49 
50  template<typename ITERT,typename T>
52 
53  template<typename ITERT,typename T>
54  using pni_io_bool_generator = boost::spirit::karma::bool_generator<T>;
55 
56  template<typename ITERT>
57  using primitive_generators =
58  boost::mpl::map<
59  boost::mpl::pair<pni::core::uint8,
61  boost::mpl::pair<pni::core::uint16,
63  boost::mpl::pair<pni::core::uint32,
65  boost::mpl::pair<pni::core::uint64,
67  boost::mpl::pair<pni::core::int8,
69  boost::mpl::pair<pni::core::int16,
71  boost::mpl::pair<pni::core::int32,
73  boost::mpl::pair<pni::core::int64,
75  boost::mpl::pair<pni::core::float32,
77  boost::mpl::pair<pni::core::float64,
79  boost::mpl::pair<pni::core::float128,
81  boost::mpl::pair<pni::core::bool_t,
83  boost::mpl::pair<pni::core::complex32,
85  boost::mpl::pair<pni::core::complex64,
87  boost::mpl::pair<pni::core::complex128,
89  >;
90 
91 //end of namespace
92 }
93 }
boost::mpl::map< boost::mpl::pair< pni::core::uint8, pni_io_uint_generator< ITERT, pni::core::uint8 >>, boost::mpl::pair< pni::core::uint16, pni_io_uint_generator< ITERT, pni::core::uint16 >>, boost::mpl::pair< pni::core::uint32, pni_io_uint_generator< ITERT, pni::core::uint32 >>, boost::mpl::pair< pni::core::uint64, pni_io_uint_generator< ITERT, pni::core::uint64 >>, boost::mpl::pair< pni::core::int8, pni_io_int_generator< ITERT, pni::core::int8 >>, boost::mpl::pair< pni::core::int16, pni_io_int_generator< ITERT, pni::core::int16 >>, boost::mpl::pair< pni::core::int32, pni_io_int_generator< ITERT, pni::core::int32 >>, boost::mpl::pair< pni::core::int64, pni_io_int_generator< ITERT, pni::core::int64 >>, boost::mpl::pair< pni::core::float32, pni_io_real_generator< ITERT, pni::core::float32 >>, boost::mpl::pair< pni::core::float64, pni_io_real_generator< ITERT, pni::core::float64 >>, boost::mpl::pair< pni::core::float128, pni_io_real_generator< ITERT, pni::core::float128 >>, boost::mpl::pair< pni::core::bool_t, pni_io_bool_generator< ITERT, pni::core::bool_t >>, boost::mpl::pair< pni::core::complex32, pni_io_complex_generator< ITERT, pni::core::float32 >>, boost::mpl::pair< pni::core::complex64, pni_io_complex_generator< ITERT, pni::core::float64 >>, boost::mpl::pair< pni::core::complex128, pni_io_complex_generator< ITERT, pni::core::float128 >> > primitive_generators
Definition: primitive_generators.hpp:89
boost::spirit::karma::int_generator< T > pni_io_int_generator
Definition: primitive_generators.hpp:45
Definition: cbf_reader.hpp:41
boost::spirit::karma::bool_generator< T > pni_io_bool_generator
Definition: primitive_generators.hpp:54
boost::spirit::karma::uint_generator< T > pni_io_uint_generator
Definition: primitive_generators.hpp:42
generator for complex numbers
Definition: complex_generator.hpp:49
boost::spirit::karma::real_generator< T, float_policy< T >> pni_io_real_generator
Definition: primitive_generators.hpp:48