/TGame/TCommon/Message/MsgHandlerIf.h

http://awoe.googlecode.com/ · C Header · 35 lines · 18 code · 10 blank · 7 comment · 0 complexity · efe031b3f9f87fd89de9d6b918cc44c4 MD5 · raw file

  1. #ifndef __MSG_HANDLER_INTERFACE__
  2. #define __MSG_HANDLER_INTERFACE__
  3. #include "MsgIf.h"
  4. class TCOM_API IMsgHandlerInitData
  5. {
  6. public:
  7. virtual ~IMsgHandlerInitData(){;}
  8. };
  9. class TCOM_API IMsgHandler
  10. {
  11. public:
  12. virtual ~IMsgHandler(){;}
  13. //
  14. //
  15. virtual bool initialize(IMsgHandlerInitData* data) = 0;
  16. //
  17. // Do handling the incoming message
  18. virtual bool handleMsg(IMsg* pMsg) = 0;
  19. //
  20. // manage sub message handler
  21. //
  22. virtual void addSubHandler(int nMsgCate, int nMsgID, IMsgHandler* pHandler) = 0;
  23. virtual void rmvSubHandler(int nMsgCate, int nMsgID) = 0;
  24. };
  25. #endif