class BOOST_PP_CAT(derived_dispatch_helper, N)
:   public script_dispatch_helper<Method_type, Return_type, ScriptableClass_type>
{
public:

    virtual
    boost::any dispatch(Method_type _function, I_ObjectReference* _pObject, std::vector<boost::any> _parms)
    {
        typename ScriptableClass_type::ScriptObjectReference_type* pObject = dynamic_cast<typename ScriptableClass_type::ScriptObjectReference_type*>(_pObject);

#define BOOST_PP_ITERATION_PARAMS_2 \
    (3, (0, M, <Zen/Core/Scripting/script_arity_conversion.hpp>))

// Only expand if M != 0
#if BOOST_PP_IF(N, 1, 0)
#include BOOST_PP_ITERATE()
#endif

        return // need this? (script_convert_argument<typename Return_type>::type)
            (getRawObject(pObject)->*_function)(BOOST_PP_ENUM_PARAMS_Z(1, N, parm));
    }
Example #2
0
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
#else // BOOST_PP_IS_ITERATING
#if BOOST_PP_ITERATION_DEPTH() == 1 // defined(BOOST_PP_IS_ITERATING)

# define N BOOST_PP_ITERATION()

   // as 'get_signature(RT(*)(T0...TN), void* = 0)' is the same
   // function as 'get_signature(RT(__cdecl *)(T0...TN), void* = 0)',
   // we don't define it twice
#  if !defined(BOOST_PYTHON_FN_CC_IS_CDECL)

template <
    class RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)>
inline BOOST_PYTHON_LIST_INC(N)<
    RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)>
get_signature(RT(BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = 0)
{
    return BOOST_PYTHON_LIST_INC(N)<
            RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)
        >();
}

#  endif // !defined(BOOST_PYTHON_FN_CC_IS_CDECL)

# undef N

# define BOOST_PP_ITERATION_PARAMS_2 \
    (3, (0, 3, <boost/python/signature.hpp>))
# include BOOST_PP_ITERATE()

#else
Example #3
0
}}} // namespace boost::python::detail

# endif // RESULT_DWA2002521_HPP

/* --------------- function pointers --------------- */
#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_FUNCTION_POINTER
# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100)                      \
        && BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3201)))
#  line BOOST_PP_LINE(__LINE__, result.hpp(function pointers))
# endif

# define N BOOST_PP_ITERATION()

template <class R BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class A)>
boost::type<R>* result(R (*pf)(BOOST_PP_ENUM_PARAMS_Z(1, N, A)), int = 0)
{
    return 0;
}

# undef N

/* --------------- pointers-to-members --------------- */
#elif BOOST_PP_ITERATION_DEPTH() == 1 && BOOST_PP_ITERATION_FLAGS() == BOOST_PYTHON_POINTER_TO_MEMBER
// Outer over cv-qualifiers

# define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PYTHON_MAX_ARITY, <boost/python/detail/result.hpp>))
# include BOOST_PP_ITERATE()

#elif BOOST_PP_ITERATION_DEPTH() == 2
# if !(BOOST_WORKAROUND(__MWERKS__, > 0x3100)                      \
}} // namespace
#   endif // v8bridge_signature_hpp
#else // BOOST_PP_IS_ITERATING
// For gcc 4.4 compatability, we must include the
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
#   if BOOST_PP_ITERATION_DEPTH() == 1 // defined(BOOST_PP_IS_ITERATING)
#       define N BOOST_PP_ITERATION()

// as 'get_signature(RT(*)(T0...TN), void* = 0)' is the same
// function as 'get_signature(RT(__cdecl *)(T0...TN), void* = 0)',
// we don't define it twice
#       if !defined(V8_FN_CC_IS_CDECL)

template <class TResult BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class TType) >
inline V8_LIST_INC(N)<TResult BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, TType) >
get_signature(TResult(V8_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, TType)), void* = 0)
{
    return V8_LIST_INC(N)<
    TResult BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, TType)
    >();
}

#       endif // !defined(V8_FN_CC_IS_CDECL)
#       undef N
#       define BOOST_PP_ITERATION_PARAMS_2 (3, (0, 3, <v8bridge/detail/signature.hpp>))

#       include BOOST_PP_ITERATE()
#   else
#       define N BOOST_PP_RELATIVE_ITERATION(1)
#       define Q V8_CV_QUALIFIER(BOOST_PP_ITERATION())