24 #ifndef FUNCTION_RETURN_TYPE_HPP
25 #define FUNCTION_RETURN_TYPE_HPP
26 #include <boost/preprocessor.hpp>
27 #include <graphlab/rpc/function_arg_types_def.hpp>
44 template <
typename RetType>
45 struct function_ret_type {
48 #define GENARGS(Z,N,_) BOOST_PP_CAT(__GLRPC_R, N) BOOST_PP_CAT(i, N)
50 #define FCALL(Z, N, _) \
51 template <typename F> \
52 static RetType BOOST_PP_CAT(fcall, N)(F f BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM(N, GENARGS, _)){ \
53 return f(BOOST_PP_ENUM_PARAMS(N, i)); \
56 BOOST_PP_REPEAT(8, FCALL , _ )
64 struct function_ret_type<void> {
67 #define GENARGS(Z,N,_) BOOST_PP_CAT(__GLRPC_R, N) BOOST_PP_CAT(i, N)
69 #define FCALL(Z, N, _) \
70 template <typename F> \
71 static size_t BOOST_PP_CAT(fcall, N)(F f BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM(N, GENARGS, _)){ \
72 f(BOOST_PP_ENUM_PARAMS(N, i)); \
76 BOOST_PP_REPEAT(8, FCALL , _ )
82 #include <graphlab/rpc/function_arg_types_undef.hpp>
88 #include <graphlab/rpc/mem_function_arg_types_def.hpp>
102 template <
typename RetType>
103 struct mem_function_ret_type {
104 typedef RetType type;
106 #define GENARGS(Z,N,_) BOOST_PP_CAT(__GLRPC_R, N) BOOST_PP_CAT(i, N)
108 #define FCALL(Z, N, _) \
109 template <typename F, typename T> \
110 static RetType BOOST_PP_CAT(fcall, N)(F f , T t BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM(N, GENARGS, _)){ \
111 return (t->*f)(BOOST_PP_ENUM_PARAMS(N, i)); \
114 BOOST_PP_REPEAT(8, FCALL , _ )
122 struct mem_function_ret_type<void> {
125 #define GENARGS(Z,N,_) BOOST_PP_CAT(__GLRPC_R, N) BOOST_PP_CAT(i, N)
127 #define FCALL(Z, N, _) \
128 template <typename F, typename T> \
129 static size_t BOOST_PP_CAT(fcall, N)(F f , T t BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM(N, GENARGS, _)){ \
130 (t->*f)(BOOST_PP_ENUM_PARAMS(N, i)); \
134 BOOST_PP_REPEAT(8, FCALL , _ )
147 #include <graphlab/rpc/mem_function_arg_types_undef.hpp>