Gaudi Framework, version v24r2

Home   Generated: Wed Dec 4 2013
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Enumerations | Functions
Gaudi::StateMachine Namespace Reference

Enumerations

enum  State { OFFLINE, CONFIGURED, INITIALIZED, RUNNING }
 Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool). More...
 
enum  Transition {
  CONFIGURE, INITIALIZE, START, STOP,
  FINALIZE, TERMINATE
}
 Allowed transitions between states. More...
 

Functions

State GAUDI_API ChangeState (const Transition transition, const State state)
 Function to get the new state according to the required transition, checking if the transition is allowed.
 

Enumeration Type Documentation

enum Gaudi::StateMachine::State

Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).

Enumerator:
OFFLINE 
CONFIGURED 
INITIALIZED 
RUNNING 

Definition at line 12 of file StateMachine.h.

{
//FINALIZED = CONFIGURED
};
enum Gaudi::StateMachine::Transition

Allowed transitions between states.

Enumerator:
CONFIGURE 
INITIALIZE 
START 
STOP 
FINALIZE 
TERMINATE 

Definition at line 23 of file StateMachine.h.

{
CONFIGURE, // OFFLINE -> CONFIGURED
INITIALIZE, // CONFIGURED -> INITIALIZED
START, // INITIALIZED -> RUNNING
STOP, // RUNNING -> INITIALIZED
FINALIZE, // INITIALIZED -> CONFIGURED
TERMINATE // CONFIGURED -> OFFLINE
};

Function Documentation

State Gaudi::StateMachine::ChangeState ( const Transition  transition,
const State  state 
)

Function to get the new state according to the required transition, checking if the transition is allowed.

Definition at line 8 of file StateMachine.cpp.

{
switch (transition) {
case CONFIGURE:
if ( OFFLINE == state ) {
return CONFIGURED;
}
break;
case INITIALIZE:
if ( CONFIGURED == state ) {
return INITIALIZED;
}
break;
case START:
if ( INITIALIZED == state ) {
return RUNNING;
}
break;
case STOP:
if ( RUNNING == state ) {
return INITIALIZED;
}
break;
case FINALIZE:
if ( INITIALIZED == state ) {
return CONFIGURED;
}
break;
case TERMINATE:
if ( CONFIGURED == state ) {
return OFFLINE;
}
break;
}
msg << "Invalid transition '" << transition << "' from state '" << state << "'";
throw GaudiException(msg.str(), "Gaudi::StateMachine::ChangeState",
return OFFLINE; // never reached, but maked the compiler happy
}

Generated at Wed Dec 4 2013 14:33:22 for Gaudi Framework, version v24r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004