SAGA Adaptor CPI v.1.0
task_declaration_impl.hpp
Go to the documentation of this file.
00001 //  Copyright (c) 2005-2009 Hartmut Kaiser
00002 //  Copyright (c) 2005-2006 Stephan Hirmer (shirmer@cct.lsu.edu)
00003 // 
00004 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
00005 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00006 
00007 #if !defined(BOOST_PP_IS_ITERATING)
00008 
00009 #if !defined(SAGA_ADAPTOR_TASK_IMPL_V1_HPP)
00010 #define SAGA_ADAPTOR_TASK_IMPL_V1_HPP
00011 
00012 #include <saga/impl/config.hpp>
00013 
00014 #include <boost/preprocessor/iterate.hpp>
00015 #include <boost/preprocessor/repetition/enum_params.hpp>
00016 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
00017 
00018 #define BOOST_PP_ITERATION_PARAMS_1                                           \
00019     (3, (1, SAGA_ARGUMENT_LIMIT,                                              \
00020     "saga/saga/adaptors/task_declaration_impl.hpp"))                          \
00021     
00022 
00023 #include BOOST_PP_ITERATE()
00024 
00025 #endif // SAGA_ADAPTOR_TASK_IMPL_V1_HPP
00026 
00028 //
00029 //  Preprocessor vertical repetition code
00030 //
00032 #else // defined(BOOST_PP_IS_ITERATING)
00033 
00034 #define P BOOST_PP_ITERATION()
00035 
00036 #define GET_TEMP_ARG(z, M, _) BOOST_PP_COMMA_IF(M) FuncArg ## M, Arg ## M
00037 
00038     private:
00043     template<
00044         typename Cpi, typename Base, typename RetVal, 
00045         BOOST_PP_ENUM_PARAMS (P, typename FuncArg),
00046         BOOST_PP_ENUM_PARAMS (P, typename Arg)
00047     >
00048     static saga::impl::task<
00049         Cpi, Base, RetVal, BOOST_PP_REPEAT(P, GET_TEMP_ARG, _)>*
00050     create_task(char const *func_name, TR1::shared_ptr<Cpi> cpi, impl::proxy* prxy, 
00051         void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg)),
00052         BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
00053         bool (Base::*prep)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), 
00054             saga::uuid));
00055 
00066     template<typename Cpi, typename Base, typename RetVal,
00067         BOOST_PP_ENUM_PARAMS(P, typename FuncArg),
00068         BOOST_PP_ENUM_PARAMS(P, typename Arg)
00069     >
00070     static saga::impl::wrapper_task <
00071         Cpi, Base, RetVal, BOOST_PP_REPEAT(P, GET_TEMP_ARG, _)>*
00072     create_task(char const *func_name, TR1::shared_ptr<Cpi> cpi, impl::proxy* prxy, 
00073         void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid),
00074         BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
00075         bool (Base::*prep)(
00076             RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid));
00077 
00078 #undef GET_TEMP_ARG
00079 
00080     public:
00081     
00092     template<
00093         typename Cpi, typename Base, typename RetVal,
00094         BOOST_PP_ENUM_PARAMS (P, typename FuncArg),
00095         BOOST_PP_ENUM_PARAMS (P, typename Arg)
00096     >
00097     task (char const *func_name, TR1::shared_ptr<Cpi> cpi, impl::proxy* prxy,
00098             void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS (P, FuncArg)),
00099             BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
00100             bool (Base::*prep)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid) = NULL);
00101 
00102     template<
00103         typename Cpi, typename Base, typename RetVal,
00104         BOOST_PP_ENUM_PARAMS (P, typename FuncArg),
00105         BOOST_PP_ENUM_PARAMS (P, typename Arg)
00106     >
00107     task (char const *func_name, TR1::shared_ptr<Cpi> cpi,
00108             void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS (P, FuncArg)),
00109             BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
00110             bool (Base::*prep)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid) = NULL);
00111 
00124     template<
00125         typename Cpi, typename Base, typename RetVal,
00126         BOOST_PP_ENUM_PARAMS (P, typename FuncArg),
00127         BOOST_PP_ENUM_PARAMS (P, typename Arg)
00128     >
00129     task (char const *func_name, TR1::shared_ptr<Cpi> cpi, impl::proxy* prxy,
00130             void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid),
00131             BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
00132             bool (Base::*prep)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid) = NULL);
00133 
00134     template<
00135         typename Cpi, typename Base, typename RetVal,
00136         BOOST_PP_ENUM_PARAMS (P, typename FuncArg),
00137         BOOST_PP_ENUM_PARAMS (P, typename Arg)
00138     >
00139     task (char const *func_name, TR1::shared_ptr<Cpi> cpi, 
00140             void (Base::*sync)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid),
00141             BOOST_PP_ENUM_BINARY_PARAMS (P, Arg, const& arg),
00142             bool (Base::*prep)(RetVal&, BOOST_PP_ENUM_PARAMS(P, FuncArg), saga::uuid) = NULL);
00143 
00144 #undef P
00145 
00146 #endif // defined(BOOST_PP_IS_ITERATING)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines