#ifndef Rice__protect__ipp_ #define Rice__protect__ipp_ // This is a generated file. DO NOT EDIT!! // This causes problems with certain C++ libraries #undef TYPE #include "detail/protect.hpp" namespace Rice { namespace detail { template class Ruby_Function_0 { public: Ruby_Function_0(Fun f); inline void operator()(); static inline VALUE call(Ruby_Function_0 * f); Ret_T const & result() const { return result_; } private: Fun f_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_0:: Ruby_Function_0(Fun f) : f_(f) { } template inline void Ruby_Function_0:: operator()() { result_ = f_(); } template inline VALUE Ruby_Function_0:: call(Ruby_Function_0 * f) { (*f)(); return Qnil; } } // namespace detail template inline Ret_T protect(Fun fun) { typedef detail::Ruby_Function_0 RF; RF f(fun); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } template inline VALUE protect(Fun fun) { typedef detail::Ruby_Function_0 RF; RF f(fun); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_1 { public: Ruby_Function_1(Fun f, T0 const & t0); inline void operator()(); static inline VALUE call(Ruby_Function_1 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_1:: Ruby_Function_1(Fun f, T0 const & t0) : f_(f), t0_(t0) { } template inline void Ruby_Function_1:: operator()() { result_ = f_(t0_); } template inline VALUE Ruby_Function_1:: call(Ruby_Function_1 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0) { typedef detail::Ruby_Function_1 RF; RF f(fun, t0); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0) { typedef detail::Ruby_Function_1 RF; RF f(fun, t0); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_2 { public: Ruby_Function_2(Fun f, T0 const & t0, T1 const & t1); inline void operator()(); static inline VALUE call(Ruby_Function_2 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_2:: Ruby_Function_2(Fun f, T0 const & t0, T1 const & t1) : f_(f), t0_(t0), t1_(t1) { } template inline void Ruby_Function_2:: operator()() { result_ = f_(t0_, t1_); } template inline VALUE Ruby_Function_2:: call(Ruby_Function_2 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1) { typedef detail::Ruby_Function_2 RF; RF f(fun, t0, t1); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1) { typedef detail::Ruby_Function_2 RF; RF f(fun, t0, t1); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_3 { public: Ruby_Function_3(Fun f, T0 const & t0, T1 const & t1, T2 const & t2); inline void operator()(); static inline VALUE call(Ruby_Function_3 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_3:: Ruby_Function_3(Fun f, T0 const & t0, T1 const & t1, T2 const & t2) : f_(f), t0_(t0), t1_(t1), t2_(t2) { } template inline void Ruby_Function_3:: operator()() { result_ = f_(t0_, t1_, t2_); } template inline VALUE Ruby_Function_3:: call(Ruby_Function_3 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2) { typedef detail::Ruby_Function_3 RF; RF f(fun, t0, t1, t2); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2) { typedef detail::Ruby_Function_3 RF; RF f(fun, t0, t1, t2); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_4 { public: Ruby_Function_4(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3); inline void operator()(); static inline VALUE call(Ruby_Function_4 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_4:: Ruby_Function_4(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3) { } template inline void Ruby_Function_4:: operator()() { result_ = f_(t0_, t1_, t2_, t3_); } template inline VALUE Ruby_Function_4:: call(Ruby_Function_4 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3) { typedef detail::Ruby_Function_4 RF; RF f(fun, t0, t1, t2, t3); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3) { typedef detail::Ruby_Function_4 RF; RF f(fun, t0, t1, t2, t3); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_5 { public: Ruby_Function_5(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4); inline void operator()(); static inline VALUE call(Ruby_Function_5 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_5:: Ruby_Function_5(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4) { } template inline void Ruby_Function_5:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_); } template inline VALUE Ruby_Function_5:: call(Ruby_Function_5 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4) { typedef detail::Ruby_Function_5 RF; RF f(fun, t0, t1, t2, t3, t4); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4) { typedef detail::Ruby_Function_5 RF; RF f(fun, t0, t1, t2, t3, t4); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_6 { public: Ruby_Function_6(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5); inline void operator()(); static inline VALUE call(Ruby_Function_6 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_6:: Ruby_Function_6(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5) { } template inline void Ruby_Function_6:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_); } template inline VALUE Ruby_Function_6:: call(Ruby_Function_6 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5) { typedef detail::Ruby_Function_6 RF; RF f(fun, t0, t1, t2, t3, t4, t5); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5) { typedef detail::Ruby_Function_6 RF; RF f(fun, t0, t1, t2, t3, t4, t5); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_7 { public: Ruby_Function_7(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6); inline void operator()(); static inline VALUE call(Ruby_Function_7 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_7:: Ruby_Function_7(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6) { } template inline void Ruby_Function_7:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_); } template inline VALUE Ruby_Function_7:: call(Ruby_Function_7 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6) { typedef detail::Ruby_Function_7 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6) { typedef detail::Ruby_Function_7 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_8 { public: Ruby_Function_8(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7); inline void operator()(); static inline VALUE call(Ruby_Function_8 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_8:: Ruby_Function_8(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7) { } template inline void Ruby_Function_8:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_); } template inline VALUE Ruby_Function_8:: call(Ruby_Function_8 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7) { typedef detail::Ruby_Function_8 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7) { typedef detail::Ruby_Function_8 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_9 { public: Ruby_Function_9(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8); inline void operator()(); static inline VALUE call(Ruby_Function_9 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_9:: Ruby_Function_9(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8) { } template inline void Ruby_Function_9:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_); } template inline VALUE Ruby_Function_9:: call(Ruby_Function_9 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8) { typedef detail::Ruby_Function_9 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8) { typedef detail::Ruby_Function_9 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_10 { public: Ruby_Function_10(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9); inline void operator()(); static inline VALUE call(Ruby_Function_10 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_10:: Ruby_Function_10(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9) { } template inline void Ruby_Function_10:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_); } template inline VALUE Ruby_Function_10:: call(Ruby_Function_10 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9) { typedef detail::Ruby_Function_10 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9) { typedef detail::Ruby_Function_10 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_11 { public: Ruby_Function_11(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10); inline void operator()(); static inline VALUE call(Ruby_Function_11 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_11:: Ruby_Function_11(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10) { } template inline void Ruby_Function_11:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_); } template inline VALUE Ruby_Function_11:: call(Ruby_Function_11 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10) { typedef detail::Ruby_Function_11 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10) { typedef detail::Ruby_Function_11 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_12 { public: Ruby_Function_12(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11); inline void operator()(); static inline VALUE call(Ruby_Function_12 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_12:: Ruby_Function_12(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11) { } template inline void Ruby_Function_12:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_); } template inline VALUE Ruby_Function_12:: call(Ruby_Function_12 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11) { typedef detail::Ruby_Function_12 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11) { typedef detail::Ruby_Function_12 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_13 { public: Ruby_Function_13(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12); inline void operator()(); static inline VALUE call(Ruby_Function_13 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_13:: Ruby_Function_13(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12) { } template inline void Ruby_Function_13:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_); } template inline VALUE Ruby_Function_13:: call(Ruby_Function_13 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12) { typedef detail::Ruby_Function_13 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12) { typedef detail::Ruby_Function_13 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_14 { public: Ruby_Function_14(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13); inline void operator()(); static inline VALUE call(Ruby_Function_14 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_; T13 const & t13_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_14:: Ruby_Function_14(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12), t13_(t13) { } template inline void Ruby_Function_14:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_, t13_); } template inline VALUE Ruby_Function_14:: call(Ruby_Function_14 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13) { typedef detail::Ruby_Function_14 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13) { typedef detail::Ruby_Function_14 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- namespace detail { template class Ruby_Function_15 { public: Ruby_Function_15(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14); inline void operator()(); static inline VALUE call(Ruby_Function_15 * f); Ret_T const & result() const { return result_; } private: Fun f_; T0 const & t0_; T1 const & t1_; T2 const & t2_; T3 const & t3_; T4 const & t4_; T5 const & t5_; T6 const & t6_; T7 const & t7_; T8 const & t8_; T9 const & t9_; T10 const & t10_; T11 const & t11_; T12 const & t12_; T13 const & t13_; T14 const & t14_; Ret_T result_; // TODO: use placement new }; template inline Ruby_Function_15:: Ruby_Function_15(Fun f, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14) : f_(f), t0_(t0), t1_(t1), t2_(t2), t3_(t3), t4_(t4), t5_(t5), t6_(t6), t7_(t7), t8_(t8), t9_(t9), t10_(t10), t11_(t11), t12_(t12), t13_(t13), t14_(t14) { } template inline void Ruby_Function_15:: operator()() { result_ = f_(t0_, t1_, t2_, t3_, t4_, t5_, t6_, t7_, t8_, t9_, t10_, t11_, t12_, t13_, t14_); } template inline VALUE Ruby_Function_15:: call(Ruby_Function_15 * f) { (*f)(); return Qnil; } } // namespace detail /** * protect on a function with a return type */ template inline Ret_T protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14) { typedef detail::Ruby_Function_15 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } /** * protect on a function with VALUE return type */ template inline VALUE protect(Fun fun, T0 const & t0, T1 const & t1, T2 const & t2, T3 const & t3, T4 const & t4, T5 const & t5, T6 const & t6, T7 const & t7, T8 const & t8, T9 const & t9, T10 const & t10, T11 const & t11, T12 const & t12, T13 const & t13, T14 const & t14) { typedef detail::Ruby_Function_15 RF; RF f(fun, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14); detail::protect( RUBY_VALUE_FUNC(RF::call), reinterpret_cast(&f)); return f.result(); } // --------------------------------------------------------------------- } // namespace Rice #endif // Rice__protect__ipp_