#define __SFJP_ROAST_roast__common_H__
#include "roast_common.h"
+#include "roast/exception.hpp"
//#include "roast/std/num_t.hpp"
/////////////////////////////////
method_pointer(method_pointer_type p) : class_ptr(0), ptr(p){}
method_pointer(_Class *p_class, method_pointer_type p_func) : class_ptr(p_class), ptr(p_func){}
- //call()
+ _Ret call(){
+ if ( p_func == 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->*p_func)();
+ }
};
/////////////////////////////////////////////////////////////