/TGame/TCommon/Observer/ObsImp.h

http://awoe.googlecode.com/ · C Header · 67 lines · 19 code · 11 blank · 37 comment · 0 complexity · e877420a732c8413f1e874f99f499454 MD5 · raw file

  1. #ifndef __OBS_IMPLEMENTATION___
  2. #define __OBS_IMPLEMENTATION___
  3. #include "ObsIf.h"
  4. class ObsImp : public IObs
  5. {
  6. public:
  7. //
  8. // ID
  9. //
  10. virtual int getID()const;
  11. //
  12. // Class identifier
  13. //
  14. virtual int getClass()const;
  15. //
  16. // Mutex Rule
  17. //
  18. virtual int getMutexRule()const;
  19. //
  20. // Mutex Group
  21. //
  22. virtual int getMutexGroup()const;
  23. //
  24. // Time To Live (Duration)
  25. //
  26. virtual int getDuration()const;
  27. //
  28. // Static Gene Data
  29. virtual IData* getStaticData();
  30. //
  31. // invoked just after gene's construction
  32. // which is used to do all the initialization
  33. //
  34. virtual bool onInit(IGeneCreateData& createData);
  35. //
  36. // invoked just after gene is attached on a host object
  37. //
  38. virtual bool onAttach();
  39. //
  40. // invoked when gene is detached from its host object
  41. //
  42. virtual bool onDetach();
  43. //
  44. // update with the host object
  45. //
  46. virtual bool onUpdate(const int& nElapse);
  47. //
  48. // response on a gene event, this is the only way gene communicate with outside logic
  49. // Note that gene can received a event only after he register it.
  50. // this the only way, gene get information from outside world,
  51. // in fact, gene is not an open man, he only trust his host, and only handle
  52. // those events that register to his host before.
  53. //
  54. virtual void onEvent(IEvt& evt);
  55. };
  56. #endif