Hideaki Tai / msgpack-embedded

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers repeat_from_to.hpp Source File

repeat_from_to.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_REPETITION_REPEAT_FROM_TO_HPP
00015 # define MSGPACK_PREPROCESSOR_REPETITION_REPEAT_FROM_TO_HPP
00016 #
00017 # include <msgpack/preprocessor/arithmetic/add.hpp>
00018 # include <msgpack/preprocessor/arithmetic/sub.hpp>
00019 # include <msgpack/preprocessor/cat.hpp>
00020 # include <msgpack/preprocessor/config/config.hpp>
00021 # include <msgpack/preprocessor/control/while.hpp>
00022 # include <msgpack/preprocessor/debug/error.hpp>
00023 # include <msgpack/preprocessor/detail/auto_rec.hpp>
00024 # include <msgpack/preprocessor/repetition/repeat.hpp>
00025 # include <msgpack/preprocessor/tuple/elem.hpp>
00026 # include <msgpack/preprocessor/tuple/rem.hpp>
00027 #
00028 # /* MSGPACK_PP_REPEAT_FROM_TO */
00029 #
00030 # if 0
00031 #    define MSGPACK_PP_REPEAT_FROM_TO(first, last, macro, data)
00032 # endif
00033 #
00034 # define MSGPACK_PP_REPEAT_FROM_TO MSGPACK_PP_CAT(MSGPACK_PP_REPEAT_FROM_TO_, MSGPACK_PP_AUTO_REC(MSGPACK_PP_REPEAT_P, 4))
00035 #
00036 # define MSGPACK_PP_REPEAT_FROM_TO_1(f, l, m, dt) MSGPACK_PP_REPEAT_FROM_TO_D_1(MSGPACK_PP_AUTO_REC(MSGPACK_PP_WHILE_P, 256), f, l, m, dt)
00037 # define MSGPACK_PP_REPEAT_FROM_TO_2(f, l, m, dt) MSGPACK_PP_REPEAT_FROM_TO_D_2(MSGPACK_PP_AUTO_REC(MSGPACK_PP_WHILE_P, 256), f, l, m, dt)
00038 # define MSGPACK_PP_REPEAT_FROM_TO_3(f, l, m, dt) MSGPACK_PP_REPEAT_FROM_TO_D_3(MSGPACK_PP_AUTO_REC(MSGPACK_PP_WHILE_P, 256), f, l, m, dt)
00039 # define MSGPACK_PP_REPEAT_FROM_TO_4(f, l, m, dt) MSGPACK_PP_ERROR(0x0003)
00040 #
00041 # define MSGPACK_PP_REPEAT_FROM_TO_1ST MSGPACK_PP_REPEAT_FROM_TO_1
00042 # define MSGPACK_PP_REPEAT_FROM_TO_2ND MSGPACK_PP_REPEAT_FROM_TO_2
00043 # define MSGPACK_PP_REPEAT_FROM_TO_3RD MSGPACK_PP_REPEAT_FROM_TO_3
00044 #
00045 # /* MSGPACK_PP_REPEAT_FROM_TO_D */
00046 #
00047 # if 0
00048 #    define MSGPACK_PP_REPEAT_FROM_TO_D(d, first, last, macro, data)
00049 # endif
00050 #
00051 # define MSGPACK_PP_REPEAT_FROM_TO_D MSGPACK_PP_CAT(MSGPACK_PP_REPEAT_FROM_TO_D_, MSGPACK_PP_AUTO_REC(MSGPACK_PP_REPEAT_P, 4))
00052 #
00053 # if ~MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_EDG()
00054 #    define MSGPACK_PP_REPEAT_FROM_TO_D_1(d, f, l, m, dt) MSGPACK_PP_REPEAT_1(MSGPACK_PP_SUB_D(d, l, f), MSGPACK_PP_REPEAT_FROM_TO_M_1, (d, f, m, dt))
00055 #    define MSGPACK_PP_REPEAT_FROM_TO_D_2(d, f, l, m, dt) MSGPACK_PP_REPEAT_2(MSGPACK_PP_SUB_D(d, l, f), MSGPACK_PP_REPEAT_FROM_TO_M_2, (d, f, m, dt))
00056 #    define MSGPACK_PP_REPEAT_FROM_TO_D_3(d, f, l, m, dt) MSGPACK_PP_REPEAT_3(MSGPACK_PP_SUB_D(d, l, f), MSGPACK_PP_REPEAT_FROM_TO_M_3, (d, f, m, dt))
00057 # else
00058 #    define MSGPACK_PP_REPEAT_FROM_TO_D_1(d, f, l, m, dt) MSGPACK_PP_REPEAT_FROM_TO_D_1_I(d, f, l, m, dt)
00059 #    define MSGPACK_PP_REPEAT_FROM_TO_D_2(d, f, l, m, dt) MSGPACK_PP_REPEAT_FROM_TO_D_2_I(d, f, l, m, dt)
00060 #    define MSGPACK_PP_REPEAT_FROM_TO_D_3(d, f, l, m, dt) MSGPACK_PP_REPEAT_FROM_TO_D_3_I(d, f, l, m, dt)
00061 #    define MSGPACK_PP_REPEAT_FROM_TO_D_1_I(d, f, l, m, dt) MSGPACK_PP_REPEAT_1(MSGPACK_PP_SUB_D(d, l, f), MSGPACK_PP_REPEAT_FROM_TO_M_1, (d, f, m, dt))
00062 #    define MSGPACK_PP_REPEAT_FROM_TO_D_2_I(d, f, l, m, dt) MSGPACK_PP_REPEAT_2(MSGPACK_PP_SUB_D(d, l, f), MSGPACK_PP_REPEAT_FROM_TO_M_2, (d, f, m, dt))
00063 #    define MSGPACK_PP_REPEAT_FROM_TO_D_3_I(d, f, l, m, dt) MSGPACK_PP_REPEAT_3(MSGPACK_PP_SUB_D(d, l, f), MSGPACK_PP_REPEAT_FROM_TO_M_3, (d, f, m, dt))
00064 # endif
00065 #
00066 # if MSGPACK_PP_CONFIG_FLAGS() & MSGPACK_PP_CONFIG_STRICT()
00067 #    define MSGPACK_PP_REPEAT_FROM_TO_M_1(z, n, dfmd) MSGPACK_PP_REPEAT_FROM_TO_M_1_IM(z, n, MSGPACK_PP_TUPLE_REM_4 dfmd)
00068 #    define MSGPACK_PP_REPEAT_FROM_TO_M_2(z, n, dfmd) MSGPACK_PP_REPEAT_FROM_TO_M_2_IM(z, n, MSGPACK_PP_TUPLE_REM_4 dfmd)
00069 #    define MSGPACK_PP_REPEAT_FROM_TO_M_3(z, n, dfmd) MSGPACK_PP_REPEAT_FROM_TO_M_3_IM(z, n, MSGPACK_PP_TUPLE_REM_4 dfmd)
00070 #    define MSGPACK_PP_REPEAT_FROM_TO_M_1_IM(z, n, im) MSGPACK_PP_REPEAT_FROM_TO_M_1_I(z, n, im)
00071 #    define MSGPACK_PP_REPEAT_FROM_TO_M_2_IM(z, n, im) MSGPACK_PP_REPEAT_FROM_TO_M_2_I(z, n, im)
00072 #    define MSGPACK_PP_REPEAT_FROM_TO_M_3_IM(z, n, im) MSGPACK_PP_REPEAT_FROM_TO_M_3_I(z, n, im)
00073 # else
00074 #    define MSGPACK_PP_REPEAT_FROM_TO_M_1(z, n, dfmd) MSGPACK_PP_REPEAT_FROM_TO_M_1_I(z, n, MSGPACK_PP_TUPLE_ELEM(4, 0, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 1, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 2, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 3, dfmd))
00075 #    define MSGPACK_PP_REPEAT_FROM_TO_M_2(z, n, dfmd) MSGPACK_PP_REPEAT_FROM_TO_M_2_I(z, n, MSGPACK_PP_TUPLE_ELEM(4, 0, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 1, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 2, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 3, dfmd))
00076 #    define MSGPACK_PP_REPEAT_FROM_TO_M_3(z, n, dfmd) MSGPACK_PP_REPEAT_FROM_TO_M_3_I(z, n, MSGPACK_PP_TUPLE_ELEM(4, 0, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 1, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 2, dfmd), MSGPACK_PP_TUPLE_ELEM(4, 3, dfmd))
00077 # endif
00078 #
00079 # define MSGPACK_PP_REPEAT_FROM_TO_M_1_I(z, n, d, f, m, dt) MSGPACK_PP_REPEAT_FROM_TO_M_1_II(z, MSGPACK_PP_ADD_D(d, n, f), m, dt)
00080 # define MSGPACK_PP_REPEAT_FROM_TO_M_2_I(z, n, d, f, m, dt) MSGPACK_PP_REPEAT_FROM_TO_M_2_II(z, MSGPACK_PP_ADD_D(d, n, f), m, dt)
00081 # define MSGPACK_PP_REPEAT_FROM_TO_M_3_I(z, n, d, f, m, dt) MSGPACK_PP_REPEAT_FROM_TO_M_3_II(z, MSGPACK_PP_ADD_D(d, n, f), m, dt)
00082 #
00083 # define MSGPACK_PP_REPEAT_FROM_TO_M_1_II(z, n, m, dt) m(z, n, dt)
00084 # define MSGPACK_PP_REPEAT_FROM_TO_M_2_II(z, n, m, dt) m(z, n, dt)
00085 # define MSGPACK_PP_REPEAT_FROM_TO_M_3_II(z, n, m, dt) m(z, n, dt)
00086 #
00087 # endif