00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PORTABLE_HPP
00019 #define PORTABLE_HPP
00020
00021 #include <string>
00022 #include <graphlab/util/generics/any.hpp>
00023 #include <graphlab/rpc/function_arg_types_def.hpp>
00024 #include <boost/preprocessor.hpp>
00025
00026 namespace graphlab {
00027
00028
00029
00030
00031
00032
00033 #define PORTABLE(f) graphlab::portable_call<typeof(f)*>(BOOST_PP_STRINGIZE(f))
00034
00035 template <typename F>
00036 struct portable_call{
00037 typedef F f_type;
00038 portable_call(){}
00039 portable_call(std::string c): fname(c) {}
00040 std::string fname;
00041 };
00042
00043 }
00044
00045
00046
00047
00048
00049 namespace boost {
00050 template <typename F>
00051 struct function_traits<graphlab::portable_call<F> > {
00052 typedef __GLRPC_FRESULT result_type;
00053 };
00054
00055
00056 template <typename F>
00057 struct function<graphlab::portable_call<F> > {
00058 typedef __GLRPC_FRESULT result_type;
00059 };
00060
00061 }
00062
00063 #include <graphlab/rpc/function_arg_types_undef.hpp>
00064 #endif
00065