#include <maciComponentStateManager.h>
Public Member Functions | |
MACIComponentStateManager (ACE_CString &compName) | |
virtual | ~MACIComponentStateManager () |
virtual ACS::ComponentStates | getCurrentState () |
virtual void | setState (ACS::ComponentStates newState) |
virtual ACE_CString | getName () |
Private Member Functions | |
bool | checkTransition (ACS::ComponentStates candidateState) |
ACE_CString | stateToString (ACS::ComponentStates state) |
Private Attributes | |
ACS::ComponentStates | componentState_m |
The current state of the component. | |
ACE_CString | componentName_m |
The name of the component (to beautify log messages). |
The default implementation of the ComponentStateManager abstract class.
maci::MACIComponentStateManager::MACIComponentStateManager | ( | ACE_CString & | compName | ) |
The constructor
virtual maci::MACIComponentStateManager::~MACIComponentStateManager | ( | ) | [inline, virtual] |
The destructor
bool maci::MACIComponentStateManager::checkTransition | ( | ACS::ComponentStates | candidateState | ) | [private] |
Check if the transition from the actual state to the requested state is consistent
At the present this function does nothing: it checks the consistency and in case of error send a message to the log. But it always returns true.
candidateState | The state to check against the current state |
virtual ACS::ComponentStates maci::MACIComponentStateManager::getCurrentState | ( | ) | [virtual] |
Returns the current state of the component
Implements maci::ComponentStateManager.
virtual ACE_CString maci::MACIComponentStateManager::getName | ( | ) | [virtual] |
Return the state in a human readable format It could be useful for logging or printing the state
Implements maci::ComponentStateManager.
virtual void maci::MACIComponentStateManager::setState | ( | ACS::ComponentStates | newState | ) | [virtual] |
Change the state of the component
newState | The new state of the component |
LifeCycleException | if the transition from the current state to the new state is not allowed |
Implements maci::ComponentStateManager.
ACE_CString maci::MACIComponentStateManager::stateToString | ( | ACS::ComponentStates | state | ) | [private] |
Convert a state to a string
state | The state to convert |
ACE_CString maci::MACIComponentStateManager::componentName_m [private] |
The name of the component (to beautify log messages).
ACS::ComponentStates maci::MACIComponentStateManager::componentState_m [private] |
The current state of the component.