diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2017-01-03 16:40:38 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2017-01-03 16:40:38 +0100 |
commit | 099e520ce5a608fe00cb9d921854b2d87966cde3 (patch) | |
tree | 682b951ce5325e7d44da1ea6637d08f869126390 /TAO/tao/LF_Event.h | |
parent | 15327947b0a014aa99909dc33e4cfc9255473542 (diff) | |
download | ATCD-099e520ce5a608fe00cb9d921854b2d87966cde3.tar.gz |
Make the leader follower state a real enum instead of using it as int, that way a compiler can detect when we assign a non-existent value
* TAO/tao/LF_CH_Event.cpp:
* TAO/tao/LF_CH_Event.h:
* TAO/tao/LF_Event.cpp:
* TAO/tao/LF_Event.h:
* TAO/tao/LF_Event.inl:
* TAO/tao/LF_Invocation_Event.cpp:
* TAO/tao/LF_Invocation_Event.h:
* TAO/tao/LF_Multi_Event.cpp:
* TAO/tao/LF_Multi_Event.h:
* TAO/tests/Bug_3531b_Regression/server.cpp:
Diffstat (limited to 'TAO/tao/LF_Event.h')
-rw-r--r-- | TAO/tao/LF_Event.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/TAO/tao/LF_Event.h b/TAO/tao/LF_Event.h index 6ea3f87001b..cba8c22d51b 100644 --- a/TAO/tao/LF_Event.h +++ b/TAO/tao/LF_Event.h @@ -82,7 +82,7 @@ public: * FSM. The possible sequence of states through which the FSM * migrates is defined in the concrete classes. */ - enum { + enum LFS_STATE { /// The event is created, and is in initial state LFS_IDLE = 0, /// The event is active @@ -97,11 +97,11 @@ public: LFS_TIMEOUT, /// The connection was closed. LFS_CONNECTION_CLOSED - }; + } ; /// Accessor to change the state. The state isn't changed unless /// certain conditions are satisfied. - void state_changed (int new_state, TAO_Leader_Follower &lf); + void state_changed (LFS_STATE new_state, TAO_Leader_Follower &lf); /** * Virtual methods for this class hierarchy.. @@ -119,14 +119,14 @@ public: //@} /// Reset the state, irrespective of the previous states - void reset_state (int new_state); + void reset_state (LFS_STATE new_state); - static const char *state_name (int st); + static const char *state_name (LFS_STATE st); protected: /// Validate the state change - virtual void state_changed_i (int new_state) = 0; + virtual void state_changed_i (LFS_STATE new_state) = 0; /// Check if we should keep waiting. bool keep_waiting_i (void) const; @@ -145,11 +145,11 @@ protected: private: /// Set the state irrespective of anything. - virtual void set_state (int new_state); + virtual void set_state (LFS_STATE new_state); protected: /// The current state - int state_; + LFS_STATE state_; /// The bounded follower TAO_LF_Follower *follower_; |