Chris@16: // Copyright 2008 Christophe Henry Chris@16: // henry UNDERSCORE christophe AT hotmail DOT com Chris@16: // This is an extended version of the state machine available in the boost::mpl library Chris@16: // Distributed under the same license as the original. Chris@16: // Copyright for the original version: Chris@16: // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed Chris@16: // under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_MSM_BACK_ARGS_H Chris@16: #define BOOST_MSM_BACK_ARGS_H Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #ifndef BOOST_MSM_VISITOR_ARG_SIZE Chris@16: #define BOOST_MSM_VISITOR_ARG_SIZE 2 // default max number of arguments Chris@16: #endif Chris@16: Chris@16: namespace boost { namespace msm { namespace back Chris@16: { Chris@16: struct no_args {}; Chris@16: #define MSM_ARGS_TYPEDEF_SUB(z, n, unused) typedef ARG ## n argument ## n ; Chris@16: #define MSM_ARGS_PRINT(z, n, data) data Chris@16: #define MSM_ARGS_NONE_PRINT(z, n, data) class data ## n = no_args \ Chris@16: BOOST_PP_COMMA_IF( BOOST_PP_LESS(n, BOOST_PP_DEC(BOOST_MSM_VISITOR_ARG_SIZE) ) ) Chris@16: Chris@16: #define MSM_VISITOR_MAIN_ARGS(n) \ Chris@16: template \ Chris@16: struct args \ Chris@16: { \ Chris@16: typedef ::boost::function type; \ Chris@16: enum {args_number=n}; \ Chris@16: BOOST_PP_REPEAT(n, MSM_ARGS_TYPEDEF_SUB, ~ ) \ Chris@16: }; Chris@16: Chris@16: #define MSM_VISITOR_ARGS(z, n, unused) \ Chris@16: template \ Chris@16: struct args \ Chris@16: { \ Chris@16: typedef ::boost::function type; \ Chris@16: enum {args_number=n}; \ Chris@16: BOOST_PP_REPEAT(n, MSM_ARGS_TYPEDEF_SUB, ~ ) \ Chris@16: }; Chris@16: MSM_VISITOR_MAIN_ARGS(BOOST_MSM_VISITOR_ARG_SIZE) Chris@16: BOOST_PP_REPEAT(BOOST_MSM_VISITOR_ARG_SIZE, MSM_VISITOR_ARGS, ~) Chris@16: Chris@16: #undef MSM_VISITOR_ARGS Chris@16: #undef MSM_ARGS_PRINT Chris@16: Chris@16: }}} Chris@16: Chris@16: #endif //BOOST_MSM_BACK_ARGS_H Chris@16: