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.10.12.1
Date:
2011/03/07 11:33:04

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 19 of file Running.cc.

References stor::Operations::safeEntryAction().

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

Definition at line 52 of file Running.cc.

References stor::Operations::safeExitAction().

53 {
55 }
void safeExitAction()
Definition: Operations.cc:108

Member Function Documentation

void Running::do_entryActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 24 of file Running.cc.

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

25 {
26 
27  TransitionRecord tr( stateName(), true );
28  outermost_context().updateHistory( tr );
29 
30  SharedResourcesPtr sharedResources =
31  outermost_context().getSharedResources();
32 
33  // Configure event distributor
34  EventDistributor* ed = outermost_context().getEventDistributor();
35  EvtStrConfigListPtr evtCfgList = sharedResources->configuration_->
36  getCurrentEventStreamConfig();
37  ErrStrConfigListPtr errCfgList = sharedResources->configuration_->
38  getCurrentErrorStreamConfig();
39  ed->registerEventStreams(evtCfgList);
40  ed->registerErrorStreams(errCfgList);
41 
42  // Clear old consumer registrations:
43  sharedResources->registrationCollection_->clearRegistrations();
44  ed->clearConsumers();
45  sharedResources->eventQueueCollection_->removeQueues();
46  sharedResources->dqmEventQueueCollection_->removeQueues();
47 
48  // Enable consumer registration:
49  sharedResources->registrationCollection_->enableConsumerRegistration();
50 }
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 57 of file Running.cc.

References stor::Operations::stateName().

58 {
59 
60  TransitionRecord tr( stateName(), false );
61  outermost_context().updateHistory( tr );
62 
63  SharedResourcesPtr sharedResources =
64  outermost_context().getSharedResources();
65 
66  // Disable consumer registration:
67  sharedResources->registrationCollection_->disableConsumerRegistration();
68 
69  // Clear consumer queues
70  sharedResources->eventQueueCollection_->clearQueues();
71  sharedResources->dqmEventQueueCollection_->clearQueues();
72 
73  // Clear the queues
74  sharedResources->fragmentQueue_->clear();
75  sharedResources->streamQueue_->clear();
76  sharedResources->dqmEventQueue_->clear();
77  sharedResources->registrationQueue_->clear();
78 
79  // Clear any fragments left in the fragment store
80  outermost_context().getFragmentStore()->clear();
81 
82 }
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 89 of file Running.cc.

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

Implements stor::Operations.

Definition at line 84 of file Running.cc.

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

Definition at line 99 of file Running.cc.

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

Definition at line 94 of file Running.cc.

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