SampleFSM.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. //
  2. // This code is generated by spgenex tool!
  3. //
  4. #include "stdafx.h"
  5. #include "SampleFSM.h"
  6. #define TIMER_LOG_SEND_ID 1
  7. CSampleFSM::CSampleFSM(void)
  8. {
  9. // TODO:
  10. }
  11. CSampleFSM::~CSampleFSM(void)
  12. {
  13. // TODO:
  14. }
  15. /*When invoke the {Init} interface of FSM instance, this function would fire immediately.
  16. * The user should not invoke this function directly.
  17. */
  18. ErrorCodeEnum CSampleFSM::OnInit()
  19. {
  20. LOG_FUNCTION();
  21. ErrorCodeEnum ec = Error_Unexpect;
  22. // TODO: user should implement the function!
  23. ec = Error_Succeed;
  24. return ec;
  25. }
  26. ErrorCodeEnum CSampleFSM::OnExit()
  27. {
  28. LOG_FUNCTION();
  29. ErrorCodeEnum ec = Error_Unexpect;
  30. // TODO: user should implement the function!
  31. return ec;
  32. }
  33. void CSampleFSM::SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext)
  34. {
  35. // TODO:
  36. }
  37. void CSampleFSM::s0_on_entry()
  38. {
  39. ScheduleTimer(TIMER_LOG_SEND_ID, SampleService_LOG_SEND_INTERVAL);
  40. }
  41. void CSampleFSM::s0_on_exit()
  42. {
  43. CancelTimer(TIMER_LOG_SEND_ID);
  44. }
  45. unsigned int CSampleFSM::s0_on_event(FSMEvent* e)
  46. {
  47. unsigned int uRet = 0;
  48. if (e->iEvt == EVT_TIMER) {
  49. //ScheduleTimer(TIMER_LOG_SEND_ID, SampleService_LOG_SEND_INTERVAL);
  50. }
  51. return uRet;
  52. }
  53. void CSampleFSM::s1_on_entry()
  54. {
  55. // TODO:
  56. }
  57. void CSampleFSM::s1_on_exit()
  58. {
  59. // TODO:
  60. }
  61. unsigned int CSampleFSM::s1_on_event(FSMEvent* e)
  62. {
  63. unsigned int uRet = 0;
  64. // TODO:
  65. return uRet;
  66. }
  67. void CSampleFSM::s2_on_entry()
  68. {
  69. // TODO:
  70. }
  71. void CSampleFSM::s2_on_exit()
  72. {
  73. // TODO:
  74. }
  75. unsigned int CSampleFSM::s2_on_event(FSMEvent* e)
  76. {
  77. unsigned int uRet = 0;
  78. // TODO:
  79. return uRet;
  80. }