Public Member Functions | Private Member Functions | Private Attributes

maci::MACIComponentStateManager Class Reference

#include <maciComponentStateManager.h>

Inheritance diagram for maci::MACIComponentStateManager:
Inheritance graph
[legend]
Collaboration diagram for maci::MACIComponentStateManager:
Collaboration graph
[legend]

List of all members.

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).

Detailed Description

The default implementation of the ComponentStateManager abstract class.


Constructor & Destructor Documentation

maci::MACIComponentStateManager::MACIComponentStateManager ( ACE_CString &  compName  ) 

The constructor

virtual maci::MACIComponentStateManager::~MACIComponentStateManager (  )  [inline, virtual]

The destructor


Member Function Documentation

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.

Parameters:
candidateState The state to check against the current state
Returns:
true if the proposed change is consistent (always in this version)
virtual ACS::ComponentStates maci::MACIComponentStateManager::getCurrentState (  )  [virtual]

Returns the current state of the component

Returns:
the 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

Returns:
A string with the name of the state

Implements maci::ComponentStateManager.

virtual void maci::MACIComponentStateManager::setState ( ACS::ComponentStates  newState  )  [virtual]

Change the state of the component

Parameters:
newState The new state of the component
Exceptions:
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

Parameters:
state The state to convert
Returns:
The string representing the state

Member Data Documentation

The name of the component (to beautify log messages).

ACS::ComponentStates maci::MACIComponentStateManager::componentState_m [private]

The current state of the component.


The documentation for this class was generated from the following file: