Class that represents, and maintains, a service state. More...
#include <serverstate.hpp>
Public Types | |
typedef function< void(State)> | ServerStateChangeCallback |
enum | State { Unknown , Initializing , Stopping , Stopped , Starting , Running } |
typedef enum kanzi::connect::ServerState::State | State |
typedef shared_ptr< void > | StateListenerSubscriptionToken |
Public Member Functions | |
State | getServerState () |
Retrieve the current state. | |
StateListenerSubscriptionToken | registerServerStateListener (ServerStateChangeCallback callback) |
Add callback to listen service states. | |
ServerState () | |
C++ constructor. initialize object. | |
void | setServerState (State state) |
Configure the server state. | |
void | unregisterServerStateListener (StateListenerSubscriptionToken token) |
Remove callback that listened server state changes. | |
Class that represents, and maintains, a service state.
typedef function<void(State)> kanzi::connect::ServerState::ServerStateChangeCallback |
typedef shared_ptr<void> kanzi::connect::ServerState::StateListenerSubscriptionToken |
kanzi::connect::ServerState::ServerState | ( | ) |
C++ constructor. initialize object.
State kanzi::connect::ServerState::getServerState | ( | ) |
Retrieve the current state.
StateListenerSubscriptionToken kanzi::connect::ServerState::registerServerStateListener | ( | ServerStateChangeCallback | callback | ) |
Add callback to listen service states.
callback | the method to invoke on changes. |
void kanzi::connect::ServerState::setServerState | ( | State | state | ) |
Configure the server state.
state | the new server state. |
void kanzi::connect::ServerState::unregisterServerStateListener | ( | StateListenerSubscriptionToken | token | ) |
Remove callback that listened server state changes.
token |