00001 #ifndef H_CALLBACK
00002 #define H_CALLBACK
00003
00004 namespace SDLPP
00005 {
00006
00007 class GenericCaller
00008 {
00009 public:
00010 virtual ~GenericCaller() {}
00011 virtual void call(const xstring&) = 0;
00012 };
00013
00014 template<class T>
00015 class MethodCaller : public GenericCaller
00016 {
00017 typedef void (T::*Method)(const xstring&);
00018 T& m_Object;
00019 Method m_Method;
00020 public:
00021 MethodCaller(T& obj, Method m)
00022 : m_Object(obj),
00023 m_Method(m)
00024 {}
00025
00026 virtual void call(const xstring& details)
00027 {
00028 ((m_Object).*(m_Method))(details);
00029 }
00030 };
00031
00032
00033 }
00034
00035
00036 #endif // H_CALLBACK