Hideaki Tai / msgpack-embedded

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers for_each.hpp Source File

for_each.hpp

00001 # /* **************************************************************************
00002 #  *                                                                          *
00003 #  *     (C) Copyright Paul Mensonides 2002.
00004 #  *     Distributed under the Boost Software License, Version 1.0. (See
00005 #  *     accompanying file LICENSE_1_0.txt or copy at
00006 #  *     http://www.boost.org/LICENSE_1_0.txt)
00007 #  *                                                                          *
00008 #  ************************************************************************** */
00009 #
00010 # /* See http://www.boost.org for most recent version. */
00011 #
00012 # ifndef MSGPACK_PREPROCESSOR_SEQ_FOR_EACH_HPP
00013 # define MSGPACK_PREPROCESSOR_SEQ_FOR_EACH_HPP
00014 #
00015 # include <msgpack/preprocessor/arithmetic/dec.hpp>
00016 # include <msgpack/preprocessor/config/config.hpp>
00017 # include <msgpack/preprocessor/repetition/for.hpp>
00018 # include <msgpack/preprocessor/seq/seq.hpp>
00019 # include <msgpack/preprocessor/seq/size.hpp>
00020 # include <msgpack/preprocessor/tuple/elem.hpp>
00021 # include <msgpack/preprocessor/tuple/rem.hpp>
00022 #
00023 # /* MSGPACK_PP_SEQ_FOR_EACH */
00024 #
00025 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
00026 #    define MSGPACK_PP_SEQ_FOR_EACH(macro, data, seq) MSGPACK_PP_FOR((macro, data, seq (nil)), MSGPACK_PP_SEQ_FOR_EACH_P, MSGPACK_PP_SEQ_FOR_EACH_O, MSGPACK_PP_SEQ_FOR_EACH_M)
00027 # else
00028 #    define MSGPACK_PP_SEQ_FOR_EACH(macro, data, seq) MSGPACK_PP_SEQ_FOR_EACH_D(macro, data, seq)
00029 #    define MSGPACK_PP_SEQ_FOR_EACH_D(macro, data, seq) MSGPACK_PP_FOR((macro, data, seq (nil)), MSGPACK_PP_SEQ_FOR_EACH_P, MSGPACK_PP_SEQ_FOR_EACH_O, MSGPACK_PP_SEQ_FOR_EACH_M)
00030 # endif
00031 #
00032 # define MSGPACK_PP_SEQ_FOR_EACH_P(r, x) MSGPACK_PP_DEC(MSGPACK_PP_SEQ_SIZE(MSGPACK_PP_TUPLE_ELEM(3, 2, x)))
00033 #
00034 # if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
00035 #    define MSGPACK_PP_SEQ_FOR_EACH_O(r, x) MSGPACK_PP_SEQ_FOR_EACH_O_I x
00036 # else
00037 #    define MSGPACK_PP_SEQ_FOR_EACH_O(r, x) MSGPACK_PP_SEQ_FOR_EACH_O_I(MSGPACK_PP_TUPLE_ELEM(3, 0, x), MSGPACK_PP_TUPLE_ELEM(3, 1, x), MSGPACK_PP_TUPLE_ELEM(3, 2, x))
00038 # endif
00039 #
00040 # define MSGPACK_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, MSGPACK_PP_SEQ_TAIL(seq))
00041 #
00042 # if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
00043 #    define MSGPACK_PP_SEQ_FOR_EACH_M(r, x) MSGPACK_PP_SEQ_FOR_EACH_M_IM(r, MSGPACK_PP_TUPLE_REM_3 x)
00044 #    define MSGPACK_PP_SEQ_FOR_EACH_M_IM(r, im) MSGPACK_PP_SEQ_FOR_EACH_M_I(r, im)
00045 # else
00046 #    define MSGPACK_PP_SEQ_FOR_EACH_M(r, x) MSGPACK_PP_SEQ_FOR_EACH_M_I(r, MSGPACK_PP_TUPLE_ELEM(3, 0, x), MSGPACK_PP_TUPLE_ELEM(3, 1, x), MSGPACK_PP_TUPLE_ELEM(3, 2, x))
00047 # endif
00048 #
00049 # define MSGPACK_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, MSGPACK_PP_SEQ_HEAD(seq))
00050 #
00051 # /* MSGPACK_PP_SEQ_FOR_EACH_R */
00052 #
00053 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
00054 #    define MSGPACK_PP_SEQ_FOR_EACH_R(r, macro, data, seq) MSGPACK_PP_FOR_ ## r((macro, data, seq (nil)), MSGPACK_PP_SEQ_FOR_EACH_P, MSGPACK_PP_SEQ_FOR_EACH_O, MSGPACK_PP_SEQ_FOR_EACH_M)
00055 # else
00056 #    define MSGPACK_PP_SEQ_FOR_EACH_R(r, macro, data, seq) MSGPACK_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq)
00057 #    define MSGPACK_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) MSGPACK_PP_FOR_ ## r((macro, data, seq (nil)), MSGPACK_PP_SEQ_FOR_EACH_P, MSGPACK_PP_SEQ_FOR_EACH_O, MSGPACK_PP_SEQ_FOR_EACH_M)
00058 # endif
00059 #
00060 # endif