Browse Source

Changed typedef to using instead.

Also added on_entry and on_exit function to the init state.
Calle 3 years ago
parent
commit
264f2b1a69
1 changed files with 6 additions and 2 deletions
  1. 6 2
      c++-mode/statemachine

+ 6 - 2
c++-mode/statemachine

@@ -69,7 +69,11 @@ public:
     */
   
     //********** Init state **********
-    struct ${2:Init}: msmf::state<> {};
+    struct ${2:Init}: msmf::state<> {
+     template <class Event, class FSM> void on_entry(Event const &, FSM &) {}
+
+     template <class Event, class FSM> void on_exit(Event const &, FSM &) {}	     
+    };
     /**
     * Define the inital state
     */
@@ -128,4 +132,4 @@ public:
   >{};
 };
 
-typedef msm::back::state_machine<$1_> $1;
+using $1=msm::back::state_machine<$1_>;