messagepack implementation for embedded systems (mbed / arduino)
Dependents: hello_message_pack
transform.hpp
00001 # /* Copyright (C) 2001 00002 # * Housemarque Oy 00003 # * http://www.housemarque.com 00004 # * 00005 # * Distributed under the Boost Software License, Version 1.0. (See 00006 # * accompanying file LICENSE_1_0.txt or copy at 00007 # * http://www.boost.org/LICENSE_1_0.txt) 00008 # */ 00009 # 00010 # /* Revised by Paul Mensonides (2002) */ 00011 # 00012 # /* See http://www.boost.org for most recent version. */ 00013 # 00014 # ifndef MSGPACK_PREPROCESSOR_LIST_TRANSFORM_HPP 00015 # define MSGPACK_PREPROCESSOR_LIST_TRANSFORM_HPP 00016 # 00017 # include <msgpack/preprocessor/config/config.hpp> 00018 # include <msgpack/preprocessor/list/fold_right.hpp> 00019 # include <msgpack/preprocessor/tuple/elem.hpp> 00020 # include <msgpack/preprocessor/tuple/rem.hpp> 00021 # 00022 # /* MSGPACK_PP_LIST_TRANSFORM */ 00023 # 00024 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00025 # define MSGPACK_PP_LIST_TRANSFORM(op, data, list) MSGPACK_PP_TUPLE_ELEM(3, 2, MSGPACK_PP_LIST_FOLD_RIGHT(MSGPACK_PP_LIST_TRANSFORM_O, (op, data, MSGPACK_PP_NIL), list)) 00026 # else 00027 # define MSGPACK_PP_LIST_TRANSFORM(op, data, list) MSGPACK_PP_LIST_TRANSFORM_I(op, data, list) 00028 # define MSGPACK_PP_LIST_TRANSFORM_I(op, data, list) MSGPACK_PP_TUPLE_ELEM(3, 2, MSGPACK_PP_LIST_FOLD_RIGHT(MSGPACK_PP_LIST_TRANSFORM_O, (op, data, MSGPACK_PP_NIL), list)) 00029 # endif 00030 # 00031 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00032 # define MSGPACK_PP_LIST_TRANSFORM_O(d, odr, elem) MSGPACK_PP_LIST_TRANSFORM_O_D(d, MSGPACK_PP_TUPLE_ELEM(3, 0, odr), MSGPACK_PP_TUPLE_ELEM(3, 1, odr), MSGPACK_PP_TUPLE_ELEM(3, 2, odr), elem) 00033 # else 00034 # define MSGPACK_PP_LIST_TRANSFORM_O(d, odr, elem) MSGPACK_PP_LIST_TRANSFORM_O_I(d, MSGPACK_PP_TUPLE_REM_3 odr, elem) 00035 # define MSGPACK_PP_LIST_TRANSFORM_O_I(d, im, elem) MSGPACK_PP_LIST_TRANSFORM_O_D(d, im, elem) 00036 # endif 00037 # 00038 # define MSGPACK_PP_LIST_TRANSFORM_O_D(d, op, data, res, elem) (op, data, (op(d, data, elem), res)) 00039 # 00040 # /* MSGPACK_PP_LIST_TRANSFORM_D */ 00041 # 00042 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG() 00043 # define MSGPACK_PP_LIST_TRANSFORM_D(d, op, data, list) MSGPACK_PP_TUPLE_ELEM(3, 2, MSGPACK_PP_LIST_FOLD_RIGHT_ ## d(MSGPACK_PP_LIST_TRANSFORM_O, (op, data, MSGPACK_PP_NIL), list)) 00044 # else 00045 # define MSGPACK_PP_LIST_TRANSFORM_D(d, op, data, list) MSGPACK_PP_LIST_TRANSFORM_D_I(d, op, data, list) 00046 # define MSGPACK_PP_LIST_TRANSFORM_D_I(d, op, data, list) MSGPACK_PP_TUPLE_ELEM(3, 2, MSGPACK_PP_LIST_FOLD_RIGHT_ ## d(MSGPACK_PP_LIST_TRANSFORM_O, (op, data, MSGPACK_PP_NIL), list)) 00047 # endif 00048 # 00049 # endif
Generated on Tue Jul 12 2022 22:51:46 by 1.7.2