mpl.ih
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
14 /** \file
15  \brief mpl internal header */
16 
17 #ifndef IH_SENF_Utils_mpl_
18 #define IH_SENF_Utils_mpl_ 1
19 
20 // Custom includes
21 
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 #define SENF_MPL_SLOT_I_CHOOSE(a,b) (a != 0 ? a-1 : (b))
25 
26 #define SENF_MPL_SLOT_I_CHECK(name,a,b) \
27  SENF_MPL_SLOT_I_CHOOSE( \
28  SENF_MPL_RV(_SENF_MPL_SLOT_ ## name (senf::mpl::take_int<(a)>())), \
29  b )
30 
31 #define SENF_MPL_SLOT_I_GET(name) \
32  SENF_MPL_SLOT_I_CHECK(name, __LINE__>1?__LINE__-1:0, \
33  SENF_MPL_SLOT_I_CHECK(name, __LINE__>2?__LINE__-2:0, \
34  SENF_MPL_SLOT_I_CHECK(name, __LINE__>3?__LINE__-3:0, \
35  SENF_MPL_SLOT_I_CHECK(name, __LINE__>4?__LINE__-4:0, \
36  SENF_MPL_SLOT_I_CHECK(name, __LINE__>5?__LINE__-5:0, \
37  SENF_MPL_SLOT_I_CHECK(name, __LINE__>6?__LINE__-6:0, \
38  SENF_MPL_SLOT_I_CHECK(name, __LINE__>7?__LINE__-7:0, \
39  SENF_MPL_SLOT_I_CHECK(name, __LINE__>8?__LINE__-8:0, \
40  SENF_MPL_SLOT_I_CHECK(name, __LINE__>9?__LINE__-9:0, \
41  SENF_MPL_SLOT_I_CHECK(name, __LINE__>10?__LINE__-10:0, \
42  SENF_MPL_SLOT_I_CHECK(name, __LINE__>11?__LINE__-11:0, \
43  SENF_MPL_SLOT_I_CHECK(name, __LINE__>12?__LINE__-12:0, \
44  SENF_MPL_SLOT_I_CHECK(name, __LINE__>13?__LINE__-13:0, \
45  SENF_MPL_SLOT_I_CHECK(name, __LINE__>14?__LINE__-14:0, \
46  SENF_MPL_SLOT_I_CHECK(name, __LINE__>15?__LINE__-15:0, \
47  SENF_MPL_SLOT_I_CHECK(name, __LINE__>16?__LINE__-16:0, \
48  SENF_MPL_SLOT_I_CHECK(name, __LINE__>17?__LINE__-17:0, \
49  SENF_MPL_SLOT_I_CHECK(name, __LINE__>18?__LINE__-18:0, \
50  SENF_MPL_SLOT_I_CHECK(name, __LINE__>19?__LINE__-19:0, \
51  SENF_MPL_SLOT_I_CHECK(name, __LINE__>20?__LINE__-20:0, \
52  SENF_MPL_SLOT_I_CHECK(name, __LINE__>21?__LINE__-21:0, \
53  SENF_MPL_SLOT_I_CHECK(name, __LINE__>22?__LINE__-22:0, \
54  SENF_MPL_SLOT_I_CHECK(name, __LINE__>23?__LINE__-23:0, \
55  SENF_MPL_SLOT_I_CHECK(name, __LINE__>24?__LINE__-24:0, \
56  SENF_MPL_SLOT_I_CHECK(name, __LINE__>25?__LINE__-25:0, \
57  SENF_MPL_SLOT_I_CHECK(name, __LINE__>26?__LINE__-26:0, \
58  SENF_MPL_SLOT_I_CHECK(name, __LINE__>27?__LINE__-27:0, \
59  SENF_MPL_SLOT_I_CHECK(name, __LINE__>28?__LINE__-28:0, \
60  SENF_MPL_SLOT_I_CHECK(name, __LINE__>29?__LINE__-29:0, \
61  SENF_MPL_SLOT_I_CHECK(name, __LINE__>30?__LINE__-30:0, \
62  SENF_MPL_SLOT_I_CHECK(name, __LINE__>31?__LINE__-31:0, \
63  SENF_MPL_SLOT_I_CHECK(name, __LINE__>32?__LINE__-32:0, \
64  SENF_MPL_SLOT_I_CHECK(name, __LINE__>33?__LINE__-33:0, \
65  SENF_MPL_SLOT_I_CHECK(name, __LINE__>34?__LINE__-34:0, \
66  SENF_MPL_SLOT_I_CHECK(name, __LINE__>35?__LINE__-35:0, \
67  SENF_MPL_SLOT_I_CHECK(name, __LINE__>36?__LINE__-36:0, \
68  SENF_MPL_SLOT_I_CHECK(name, __LINE__>37?__LINE__-37:0, \
69  SENF_MPL_SLOT_I_CHECK(name, __LINE__>38?__LINE__-38:0, \
70  SENF_MPL_SLOT_I_CHECK(name, __LINE__>39?__LINE__-39:0, \
71  SENF_MPL_SLOT_I_CHECK(name, __LINE__>40?__LINE__-40:0, \
72  0 ))))))))))))))))))))))))))))))))))))))))
73 
74 
75 //-/////////////////////////////////////////////////////////////////////////////////////////////////
76 #endif
77 
78 
79 // Local Variables:
80 // mode: c++
81 // fill-column: 100
82 // comment-column: 40
83 // c-file-style: "senf"
84 // indent-tabs-mode: nil
85 // ispell-local-dictionary: "american"
86 // compile-command: "scons -u test"
87 // End: