Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef EVENTRECEIVER_H
- #define EVENTRECEIVER_H
- namespace Cappra
- {
- class UIEvent;
- }
- namespace Cappra
- {
- template <class EventReceiver> class CallBack
- {
- private:
- void (EventReceiver::*cFunc)(UIEvent* e);
- EventReceiver* cObj;
- public:
- CallBack(EventReceiver* pObj, void(EventReceiver::*pFunc)())
- {
- cObj = pObj;
- cFunc = pFunc;
- }
- void operator()(UIEvent* e)
- {
- (*cObj.*cFunc)(e);
- }
- };
- }
- #endif // EVENTRECEIVER_H
Add Comment
Please, Sign In to add comment