CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions
stor::Running Class Reference

#include <StateMachine.h>

Inheritance diagram for stor::Running:
stor::Operations

Public Types

typedef bsc::transition
< EmergencyStop, Stopping
EST
 
typedef bsc::transition
< EndRun, Stopping
ET
 
typedef bsc::in_state_reaction
< HaltDone, Running,&Running::logHaltDoneRequest
HaltDoneIR
 
typedef bsc::transition< Halt,
Halting
HT
 
typedef boost::mpl::list< ET,
EST, HT, StopDoneIR,
HaltDoneIR
reactions
 
typedef bsc::in_state_reaction
< StopDone, Running,&Running::logStopDoneRequest
StopDoneIR
 

Public Member Functions

void logHaltDoneRequest (const HaltDone &request)
 
void logStopDoneRequest (const StopDone &request)
 
 Running (my_context)
 
virtual ~Running ()
 
- Public Member Functions inherited from stor::Operations
void moveToFailedState (xcept::Exception &exception) const
 
void noFragmentToProcess () const
 
 Operations ()
 
void processI2OFragment (I2OChain &frag) const
 
std::string stateName () const
 
virtual ~Operations ()=0
 

Private Member Functions

virtual void do_entryActionWork ()
 
virtual void do_exitActionWork ()
 
virtual void do_moveToFailedState (xcept::Exception &exception) const
 
virtual std::string do_stateName () const
 

Additional Inherited Members

- Protected Member Functions inherited from stor::Operations
virtual void do_noFragmentToProcess () const
 
virtual void do_processI2OFragment (I2OChain &frag) const
 
void safeEntryAction ()
 
void safeExitAction ()
 

Detailed Description

Running state

Author:
mommsen
Revision:
1.11
Date:
2011/03/07 15:31:32

Definition at line 469 of file StateMachine.h.

Member Typedef Documentation

typedef bsc::transition<EmergencyStop,Stopping> stor::Running::EST

Definition at line 478 of file StateMachine.h.

typedef bsc::transition<EndRun,Stopping> stor::Running::ET

Definition at line 477 of file StateMachine.h.

Definition at line 481 of file StateMachine.h.

typedef bsc::transition<Halt,Halting> stor::Running::HT

Definition at line 479 of file StateMachine.h.

Definition at line 482 of file StateMachine.h.

Definition at line 480 of file StateMachine.h.

Constructor & Destructor Documentation

Running::Running ( my_context  c)

Definition at line 20 of file Running.cc.

References stor::Operations::safeEntryAction().

20  : my_base(c)
21 {
23 }
void safeEntryAction()
Definition: Operations.cc:77
Running::~Running ( )
virtual

Definition at line 53 of file Running.cc.

References stor::Operations::safeExitAction().

54 {
56 }
void safeExitAction()
Definition: Operations.cc:108

Member Function Documentation

void Running::do_entryActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 25 of file Running.cc.

References stor::EventDistributor::clearConsumers(), stor::EventDistributor::registerErrorStreams(), stor::EventDistributor::registerEventStreams(), and stor::Operations::stateName().

26 {
27 
28  TransitionRecord tr( stateName(), true );
29  outermost_context().updateHistory( tr );
30 
31  SharedResourcesPtr sharedResources =
32  outermost_context().getSharedResources();
33 
34  // Configure event distributor
35  EventDistributor* ed = outermost_context().getEventDistributor();
36  EvtStrConfigListPtr evtCfgList = sharedResources->configuration_->
37  getCurrentEventStreamConfig();
38  ErrStrConfigListPtr errCfgList = sharedResources->configuration_->
39  getCurrentErrorStreamConfig();
40  ed->registerEventStreams(evtCfgList);
41  ed->registerErrorStreams(errCfgList);
42 
43  // Clear old consumer registrations:
44  sharedResources->registrationCollection_->clearRegistrations();
45  ed->clearConsumers();
46  sharedResources->eventQueueCollection_->removeQueues();
47  sharedResources->dqmEventQueueCollection_->removeQueues();
48 
49  // Enable consumer registration:
50  sharedResources->registrationCollection_->enableConsumerRegistration();
51 }
std::string stateName() const
Definition: Operations.cc:39
boost::shared_ptr< ErrStrConfigList > ErrStrConfigListPtr
void registerErrorStreams(const ErrStrConfigListPtr)
boost::shared_ptr< SharedResources > SharedResourcesPtr
boost::shared_ptr< EvtStrConfigList > EvtStrConfigListPtr
void registerEventStreams(const EvtStrConfigListPtr)
void Running::do_exitActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 58 of file Running.cc.

References stor::Operations::stateName().

59 {
60 
61  TransitionRecord tr( stateName(), false );
62  outermost_context().updateHistory( tr );
63 
64  SharedResourcesPtr sharedResources =
65  outermost_context().getSharedResources();
66 
67  // Disable consumer registration:
68  sharedResources->registrationCollection_->disableConsumerRegistration();
69 
70  // Clear consumer queues
71  sharedResources->eventQueueCollection_->clearQueues();
72  sharedResources->dqmEventQueueCollection_->clearQueues();
73 
74  // Clear the queues
75  sharedResources->fragmentQueue_->clear();
76  sharedResources->streamQueue_->clear();
77  sharedResources->dqmEventQueue_->clear();
78  sharedResources->registrationQueue_->clear();
79 
80  // Clear any fragments left in the fragment store
81  outermost_context().getFragmentStore()->clear();
82 
83 }
std::string stateName() const
Definition: Operations.cc:39
boost::shared_ptr< SharedResources > SharedResourcesPtr
void Running::do_moveToFailedState ( xcept::Exception &  exception) const
privatevirtual

Implements stor::Operations.

Definition at line 90 of file Running.cc.

91 {
92  outermost_context().getSharedResources()->alarmHandler_->moveToFailedState( exception );
93 }
string Running::do_stateName ( ) const
privatevirtual

Implements stor::Operations.

Definition at line 85 of file Running.cc.

86 {
87  return std::string( "Running" );
88 }
void Running::logHaltDoneRequest ( const HaltDone request)

Definition at line 100 of file Running.cc.

101 {
102  outermost_context().unconsumed_event( request );
103 }
void Running::logStopDoneRequest ( const StopDone request)

Definition at line 95 of file Running.cc.

96 {
97  outermost_context().unconsumed_event( request );
98 }