messagepack implementation for embedded systems (mbed / arduino)

Dependents:   hello_message_pack

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers pop_back.hpp Source File

pop_back.hpp

00001 # /* **************************************************************************
00002 #  *                                                                          *
00003 #  *     (C) Copyright Edward Diener 2013.
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_TUPLE_POP_BACK_HPP
00013 # define MSGPACK_PREPROCESSOR_TUPLE_POP_BACK_HPP
00014 #
00015 # include <msgpack/preprocessor/config/config.hpp>
00016 #
00017 # if MSGPACK_PP_VARIADICS
00018 #
00019 # include <msgpack/preprocessor/array/pop_back.hpp>
00020 # include <msgpack/preprocessor/array/to_tuple.hpp>
00021 # include <msgpack/preprocessor/comparison/greater.hpp>
00022 # include <msgpack/preprocessor/control/iif.hpp>
00023 # include <msgpack/preprocessor/tuple/size.hpp>
00024 # include <msgpack/preprocessor/tuple/to_array.hpp>
00025 #
00026 # /* MSGPACK_PP_TUPLE_POP_BACK */
00027 #
00028 # define MSGPACK_PP_TUPLE_POP_BACK(tuple) \
00029     MSGPACK_PP_IIF \
00030         ( \
00031         MSGPACK_PP_GREATER(MSGPACK_PP_TUPLE_SIZE(tuple),1), \
00032         MSGPACK_PP_TUPLE_POP_BACK_EXEC, \
00033         MSGPACK_PP_TUPLE_POP_BACK_RETURN \
00034         ) \
00035     (tuple) \
00036 /**/
00037 #
00038 # define MSGPACK_PP_TUPLE_POP_BACK_EXEC(tuple) \
00039     MSGPACK_PP_ARRAY_TO_TUPLE(MSGPACK_PP_ARRAY_POP_BACK(MSGPACK_PP_TUPLE_TO_ARRAY(tuple))) \
00040 /**/
00041 #
00042 # define MSGPACK_PP_TUPLE_POP_BACK_RETURN(tuple) tuple
00043 #
00044 # /* MSGPACK_PP_TUPLE_POP_BACK_Z */
00045 #
00046 # define MSGPACK_PP_TUPLE_POP_BACK_Z(z, tuple) \
00047     MSGPACK_PP_IIF \
00048         ( \
00049         MSGPACK_PP_GREATER(MSGPACK_PP_TUPLE_SIZE(tuple),1), \
00050         MSGPACK_PP_TUPLE_POP_BACK_Z_EXEC, \
00051         MSGPACK_PP_TUPLE_POP_BACK_Z_RETURN \
00052         ) \
00053     (z, tuple) \
00054 /**/
00055 #
00056 # define MSGPACK_PP_TUPLE_POP_BACK_Z_EXEC(z, tuple) \
00057     MSGPACK_PP_ARRAY_TO_TUPLE(MSGPACK_PP_ARRAY_POP_BACK_Z(z, MSGPACK_PP_TUPLE_TO_ARRAY(tuple))) \
00058 /**/
00059 #
00060 # define MSGPACK_PP_TUPLE_POP_BACK_Z_RETURN(z, tuple) tuple
00061 #
00062 # endif // MSGPACK_PP_VARIADICS
00063 #
00064 # endif // MSGPACK_PREPROCESSOR_TUPLE_POP_BACK_HPP