blob: 660a522845629e692dbe590820fe3746fd627001 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
2// (C) Copyright Tobias Schwinger
3//
4// Use modification and distribution are subject to the boost Software License,
5// Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
6
7//------------------------------------------------------------------------------
8
9#ifndef BOOST_FT_DETAIL_SYNTHESIZE_HPP_INCLUDED
10#define BOOST_FT_DETAIL_SYNTHESIZE_HPP_INCLUDED
11
12#include <cstddef>
13
14#include <ndnboost/mpl/at.hpp>
15#include <ndnboost/mpl/size.hpp>
16
17#include <ndnboost/function_types/config/config.hpp>
18#include <ndnboost/function_types/property_tags.hpp>
19#include <ndnboost/function_types/detail/cv_traits.hpp>
20#include <ndnboost/function_types/detail/retag_default_cc.hpp>
21
22namespace ndnboost { namespace function_types { namespace detail {
23
24template<bits_t Flags, bits_t CCID, std::size_t Size>
25struct synthesize_impl_o
26{
27 template<typename Seq> struct synthesize_impl_i { };
28};
29
30template<typename Seq, bits_t Bits>
31struct synthesize_impl
32 : detail::synthesize_impl_o
33 < ::ndnboost::function_types::detail::decode_bits<Bits>::flags
34 , ::ndnboost::function_types::detail::decode_bits<Bits>::cc_id
35 , ::ndnboost::mpl::size<Seq>::value
36 >
37 ::template synthesize_impl_i<Seq>
38{ };
39
40template<typename Seq, typename Tag>
41struct synthesize_func
42 : detail::synthesize_impl
43 < Seq
44 , ::ndnboost::function_types::detail::bits
45 < detail::retag_default_cc
46 < function_types::tag<nv_dcc_func, Tag> >
47 >::value
48 >
49{ };
50
51template<typename Seq, typename Tag>
52struct synthesize_mfp
53 : detail::synthesize_impl
54 < Seq
55 , ::ndnboost::function_types::detail::bits
56 < detail::retag_default_cc
57 < function_types::tag
58 < typename detail::cv_traits< typename mpl::at_c<Seq,1>::type >::tag
59 , nv_dcc_mfp, Tag
60 > >
61 >::value
62 >
63{ };
64
65template<typename S, typename R = typename mpl::at_c<S,0>::type,
66 typename C = typename mpl::at_c<S,1>::type>
67struct synthesize_mop
68{
69 typedef R C::* type;
70};
71
72#define BOOST_FT_variations BOOST_FT_function|BOOST_FT_member_pointer
Jeff Thompson9939dcd2013-10-15 15:12:24 -070073#define BOOST_FT_al_path ndnboost/function_types/detail/synthesize_impl
Jeff Thompsona28eed82013-08-22 16:21:10 -070074#include <ndnboost/function_types/detail/pp_loop.hpp>
75
76} } } // namespace ::ndnboost::function_types::detail
77
78#endif
79