Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | // Copyright (C) 2005 Arkadiy Vertleyb |
| 2 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 4 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 5 | #ifndef NDNBOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED |
| 6 | #define NDNBOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 7 | |
| 8 | #include <ndnboost/preprocessor/cat.hpp> |
| 9 | #include <ndnboost/preprocessor/repetition/repeat.hpp> |
| 10 | |
| 11 | // Assumes iter0 contains initial iterator |
| 12 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 13 | #define NDNBOOST_TYPEOF_DECODE_PARAM(z, n, text) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 14 | typedef ndnboost::type_of::decode_type<iter##n> decode##n; \ |
| 15 | typedef typename decode##n::type p##n; \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 16 | typedef typename decode##n::iter NDNBOOST_PP_CAT(iter, NDNBOOST_PP_INC(n)); |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 17 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 18 | #define NDNBOOST_TYPEOF_DECODE_PARAMS(n)\ |
| 19 | NDNBOOST_PP_REPEAT(n, NDNBOOST_TYPEOF_DECODE_PARAM, ~) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 20 | |
| 21 | // The P0, P1, ... PN are encoded and added to V |
| 22 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 23 | #define NDNBOOST_TYPEOF_ENCODE_PARAMS_BEGIN(z, n, text)\ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 24 | typename ndnboost::type_of::encode_type< |
| 25 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 26 | #define NDNBOOST_TYPEOF_ENCODE_PARAMS_END(z, n, text)\ |
| 27 | , NDNBOOST_PP_CAT(P, n)>::type |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 28 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 29 | #define NDNBOOST_TYPEOF_ENCODE_PARAMS(n, ID) \ |
| 30 | NDNBOOST_PP_REPEAT(n, NDNBOOST_TYPEOF_ENCODE_PARAMS_BEGIN, ~) \ |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 31 | typename ndnboost::type_of::push_back<V, ndnboost::mpl::size_t<ID> >::type \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 32 | NDNBOOST_PP_REPEAT(n, NDNBOOST_TYPEOF_ENCODE_PARAMS_END, ~) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 33 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 34 | #endif//NDNBOOST_TYPEOF_ENCODE_DECODE_PARAMS_HPP_INCLUDED |