blob: 5e86342e11e95b9b45c7159a44d7482312e67e00 [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// no include guards, this file is guarded externally
10
11#ifdef __WAVE__
12// this file has been generated from the master.hpp file in the same directory
13# pragma wave option(preserve: 0)
14#endif
15
Jeff Thompson3d613fd2013-10-15 15:39:04 -070016#if !defined(NDNBOOST_FT_PREPROCESSING_MODE) || defined(NDNBOOST_FT_CONFIG_HPP_INCLUDED)
Jeff Thompsona28eed82013-08-22 16:21:10 -070017# error "this file used with two-pass preprocessing, only"
18#endif
19
20#include <ndnboost/preprocessor/slot/slot.hpp>
21#include <ndnboost/function_types/detail/encoding/def.hpp>
22
23namespace ndnboost { namespace function_types {
24
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025typedef detail::property_tag<NDNBOOST_FT_non_variadic,NDNBOOST_FT_variadic_mask> non_variadic;
26typedef detail::property_tag<NDNBOOST_FT_variadic,NDNBOOST_FT_variadic_mask> variadic;
Jeff Thompsona28eed82013-08-22 16:21:10 -070027
Jeff Thompson3d613fd2013-10-15 15:39:04 -070028typedef detail::property_tag<0,NDNBOOST_FT_const> non_const;
29typedef detail::property_tag<NDNBOOST_FT_const,NDNBOOST_FT_const> const_qualified;
Jeff Thompsona28eed82013-08-22 16:21:10 -070030
Jeff Thompson3d613fd2013-10-15 15:39:04 -070031typedef detail::property_tag<0,NDNBOOST_FT_volatile> non_volatile;
32typedef detail::property_tag<NDNBOOST_FT_volatile,NDNBOOST_FT_volatile> volatile_qualified;
Jeff Thompsona28eed82013-08-22 16:21:10 -070033
Jeff Thompson3d613fd2013-10-15 15:39:04 -070034typedef detail::property_tag<NDNBOOST_FT_default_cc,NDNBOOST_FT_cc_mask> default_cc;
Jeff Thompsona28eed82013-08-22 16:21:10 -070035
Jeff Thompson3d613fd2013-10-15 15:39:04 -070036#define NDNBOOST_PP_VALUE NDNBOOST_FT_const|NDNBOOST_FT_volatile
37#include NDNBOOST_PP_ASSIGN_SLOT(1)
Jeff Thompsona28eed82013-08-22 16:21:10 -070038
Jeff Thompson3d613fd2013-10-15 15:39:04 -070039typedef detail::property_tag<0 , NDNBOOST_PP_SLOT(1)> non_cv;
40typedef detail::property_tag<NDNBOOST_FT_const , NDNBOOST_PP_SLOT(1)> const_non_volatile;
41typedef detail::property_tag<NDNBOOST_FT_volatile, NDNBOOST_PP_SLOT(1)> volatile_non_const;
42typedef detail::property_tag<NDNBOOST_PP_SLOT(1) , NDNBOOST_PP_SLOT(1)> cv_qualified;
Jeff Thompsona28eed82013-08-22 16:21:10 -070043
44namespace detail {
45
Jeff Thompson3d613fd2013-10-15 15:39:04 -070046 typedef constant<NDNBOOST_FT_full_mask> full_mask;
Jeff Thompsona28eed82013-08-22 16:21:10 -070047
48 template <bits_t Flags, bits_t CCID> struct encode_bits_impl
49 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050 NDNBOOST_STATIC_CONSTANT( bits_t, value =
51 Flags | (NDNBOOST_FT_default_cc * CCID) << 1 );
Jeff Thompsona28eed82013-08-22 16:21:10 -070052 };
53
54 template <bits_t Flags, bits_t CCID, std::size_t Arity>
55 struct encode_charr_impl
56 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070057 NDNBOOST_STATIC_CONSTANT(std::size_t, value = (std::size_t)(1+
58 Flags | (NDNBOOST_FT_default_cc * CCID) << 1 | Arity << NDNBOOST_FT_arity_shift
Jeff Thompsona28eed82013-08-22 16:21:10 -070059 ));
60 };
61
62 template <bits_t Bits> struct decode_bits
63 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070064 NDNBOOST_STATIC_CONSTANT(bits_t, flags = Bits & NDNBOOST_FT_flags_mask);
Jeff Thompsona28eed82013-08-22 16:21:10 -070065
Jeff Thompson3d613fd2013-10-15 15:39:04 -070066 NDNBOOST_STATIC_CONSTANT(bits_t, cc_id =
67 ( (Bits & NDNBOOST_FT_full_mask) / NDNBOOST_FT_default_cc) >> 1
Jeff Thompsona28eed82013-08-22 16:21:10 -070068 );
69
Jeff Thompson3d613fd2013-10-15 15:39:04 -070070 NDNBOOST_STATIC_CONSTANT(bits_t, tag_bits = (Bits & NDNBOOST_FT_full_mask));
Jeff Thompsona28eed82013-08-22 16:21:10 -070071
Jeff Thompson3d613fd2013-10-15 15:39:04 -070072 NDNBOOST_STATIC_CONSTANT(std::size_t, arity = (std::size_t)
73 (Bits >> NDNBOOST_FT_arity_shift)
Jeff Thompsona28eed82013-08-22 16:21:10 -070074 );
75 };
76
77 template <bits_t LHS_bits, bits_t LHS_mask, bits_t RHS_bits, bits_t RHS_mask>
78 struct tag_ice
79 {
Jeff Thompson3d613fd2013-10-15 15:39:04 -070080 NDNBOOST_STATIC_CONSTANT(bool, match =
81 RHS_bits == (LHS_bits & RHS_mask & (RHS_bits |~NDNBOOST_FT_type_mask))
Jeff Thompsona28eed82013-08-22 16:21:10 -070082 );
83
Jeff Thompson3d613fd2013-10-15 15:39:04 -070084 NDNBOOST_STATIC_CONSTANT(bits_t, combined_bits =
Jeff Thompsona28eed82013-08-22 16:21:10 -070085 (LHS_bits & ~RHS_mask) | RHS_bits
86 );
87
Jeff Thompson3d613fd2013-10-15 15:39:04 -070088 NDNBOOST_STATIC_CONSTANT(bits_t, combined_mask =
Jeff Thompsona28eed82013-08-22 16:21:10 -070089 LHS_mask | RHS_mask
90 );
91
Jeff Thompson3d613fd2013-10-15 15:39:04 -070092 NDNBOOST_STATIC_CONSTANT(bits_t, extracted_bits =
Jeff Thompsona28eed82013-08-22 16:21:10 -070093 LHS_bits & RHS_mask
94 );
95
96 };
97
Jeff Thompson3d613fd2013-10-15 15:39:04 -070098#define NDNBOOST_FT_mask NDNBOOST_FT_type_mask
99 typedef property_tag<NDNBOOST_FT_callable_builtin,NDNBOOST_FT_mask> callable_builtin_tag;
100 typedef property_tag<NDNBOOST_FT_non_member_callable_builtin,NDNBOOST_FT_mask> nonmember_callable_builtin_tag;
101 typedef property_tag<NDNBOOST_FT_function,NDNBOOST_FT_mask> function_tag;
102 typedef property_tag<NDNBOOST_FT_reference,NDNBOOST_FT_mask> reference_tag;
103 typedef property_tag<NDNBOOST_FT_pointer,NDNBOOST_FT_mask> pointer_tag;
104 typedef property_tag<NDNBOOST_FT_member_function_pointer,NDNBOOST_FT_mask> member_function_pointer_tag;
105 typedef property_tag<NDNBOOST_FT_member_object_pointer,NDNBOOST_FT_mask> member_object_pointer_tag;
106 typedef property_tag<NDNBOOST_FT_member_object_pointer_flags,NDNBOOST_FT_full_mask> member_object_pointer_base;
107 typedef property_tag<NDNBOOST_FT_member_pointer,NDNBOOST_FT_mask> member_pointer_tag;
108#undef NDNBOOST_FT_mask
Jeff Thompsona28eed82013-08-22 16:21:10 -0700109
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700110#define NDNBOOST_PP_VALUE NDNBOOST_FT_function|NDNBOOST_FT_non_variadic|NDNBOOST_FT_default_cc
111#include NDNBOOST_PP_ASSIGN_SLOT(1)
112#define NDNBOOST_PP_VALUE NDNBOOST_FT_type_mask|NDNBOOST_FT_variadic_mask|NDNBOOST_FT_cc_mask
113#include NDNBOOST_PP_ASSIGN_SLOT(2)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700114
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700115 typedef property_tag< NDNBOOST_PP_SLOT(1) , NDNBOOST_PP_SLOT(2) > nv_dcc_func;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700116
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700117#define NDNBOOST_PP_VALUE \
118 NDNBOOST_FT_member_function_pointer|NDNBOOST_FT_non_variadic|NDNBOOST_FT_default_cc
119#include NDNBOOST_PP_ASSIGN_SLOT(1)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700120
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700121 typedef property_tag< NDNBOOST_PP_SLOT(1) , NDNBOOST_PP_SLOT(2) > nv_dcc_mfp;
Jeff Thompsona28eed82013-08-22 16:21:10 -0700122
123} // namespace detail
124
125} } // namespace ::ndnboost::function_types
126