};
/////////////////////////////////////////////////////////////
+
+ template <typename _Ret, typename _Class, typename T1, typename T2>
+ class method_pointer<_Ret,_Class,T1,T2>
+ {
+ public:
+ typedef typename method_pointer_type<_Ret,_Class,T1,T2>::type type, pointer_type, method_pointer_type;
+ _Class *class_ptr;
+ method_pointer_type func_ptr;
+
+ method_pointer() : class_ptr(0), func_ptr(0){}
+ method_pointer(method_pointer_type p) : class_ptr(0), func_ptr(p){}
+ method_pointer(_Class &class_ref, method_pointer_type p_func) : class_ptr(&class_ref), func_ptr(p_func){}
+ method_pointer(_Class *p_class, method_pointer_type p_func) : class_ptr(p_class), func_ptr(p_func){}
+
+ _Ret call(T1 t1, T2 t2){
+ if ( func_ptr == 0 )
+ throw ::roast::exception("method_pointer::call() Not initialized function pointer.");
+ if ( class_ptr == 0 )
+ throw ::roast::exception("method_pointer::call() Not initialized class pointer.");
+ return (class_ptr->*func_ptr)(t1,t2);
+ }
+ _Ret call(method_pointer_type p_func, T1 t1, T2 t2){
+ func_ptr = p_func;
+ return call(t1,t2);
+ }
+ _Ret call(_Class *p_class, T1 t1, T2 t2){
+ class_ptr = p_class;
+ return call(t1,t2);
+ }
+ _Ret call(_Class &class_ref, T1 t1, T2 t2){
+ class_ptr = &class_ref;
+ return call(t1,t2);
+ }
+
+ _Ret operator()( T1 t1, T2 t2)
+ {
+ return call(t1,t2);
+ }
+ };
+
+ /////////////////////////////////////////////////////////////
}
#include "roast/tp/method_pointer_make.hpp"