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::Starting Class Reference

#include <StateMachine.h>

Inheritance diagram for stor::Starting:
stor::Operations

Public Types

typedef bsc::transition
< EmergencyStop, Stopping
ET
 
typedef bsc::in_state_reaction
< HaltDone, Starting,&Starting::logHaltDoneRequest
HaltDoneIR
 
typedef boost::mpl::list< ST,
ET, StopDoneIR, HaltDoneIR
reactions
 
typedef bsc::transition
< StartRun, Running
ST
 
typedef bsc::in_state_reaction
< StopDone, Starting,&Starting::logStopDoneRequest
StopDoneIR
 

Public Member Functions

void logHaltDoneRequest (const HaltDone &request)
 
void logStopDoneRequest (const StopDone &request)
 
 Starting (my_context)
 
virtual ~Starting ()
 
- 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 void do_noFragmentToProcess () const
 
virtual std::string do_stateName () const
 
bool workerThreadsConfigured () const
 

Additional Inherited Members

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

Detailed Description

Starting state

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

Definition at line 369 of file StateMachine.h.

Member Typedef Documentation

typedef bsc::transition<EmergencyStop,Stopping> stor::Starting::ET

Definition at line 378 of file StateMachine.h.

Definition at line 380 of file StateMachine.h.

Definition at line 381 of file StateMachine.h.

typedef bsc::transition<StartRun,Running> stor::Starting::ST

Definition at line 377 of file StateMachine.h.

Definition at line 379 of file StateMachine.h.

Constructor & Destructor Documentation

Starting::Starting ( my_context  c)

Definition at line 21 of file Starting.cc.

References stor::Operations::safeEntryAction().

21  : my_base(c)
22 {
24 }
void safeEntryAction()
Definition: Operations.cc:77
Starting::~Starting ( )
virtual

Definition at line 55 of file Starting.cc.

References stor::Operations::safeExitAction().

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

Member Function Documentation

void Starting::do_entryActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 26 of file Starting.cc.

References stor::WorkerThreadParams::DQMEPdeqWaitTime_, stor::WorkerThreadParams::DWdeqWaitTime_, and stor::Operations::stateName().

27 {
28  TransitionRecord tr( stateName(), true );
29  outermost_context().updateHistory( tr );
30 
31  SharedResourcesPtr sharedResources =
32  outermost_context().getSharedResources();
33 
34  // Request DiskWriter to configure streams
35  EvtStrConfigListPtr evtCfgList = sharedResources->configuration_->
36  getCurrentEventStreamConfig();
37  ErrStrConfigListPtr errCfgList = sharedResources->configuration_->
38  getCurrentErrorStreamConfig();
39 
40  WorkerThreadParams workerParams =
41  sharedResources->configuration_->getWorkerThreadParams();
42  sharedResources->diskWriterResources_->
43  requestStreamConfiguration(evtCfgList, errCfgList,
44  sharedResources->configuration_->getDiskWritingParams(),
45  sharedResources->configuration_->getRunNumber(),
46  workerParams.DWdeqWaitTime_);
47 
48  // Request configuration of DQMEventProcessor
49  sharedResources->dqmEventProcessorResources_->
50  requestConfiguration(
51  sharedResources->configuration_->getDQMProcessingParams(),
52  workerParams.DQMEPdeqWaitTime_);
53 }
std::string stateName() const
Definition: Operations.cc:39
boost::shared_ptr< ErrStrConfigList > ErrStrConfigListPtr
boost::shared_ptr< SharedResources > SharedResourcesPtr
boost::shared_ptr< EvtStrConfigList > EvtStrConfigListPtr
boost::posix_time::time_duration DQMEPdeqWaitTime_
boost::posix_time::time_duration DWdeqWaitTime_
void Starting::do_exitActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 60 of file Starting.cc.

References stor::Operations::stateName().

61 {
62  TransitionRecord tr( stateName(), false );
63  outermost_context().updateHistory( tr );
64 }
std::string stateName() const
Definition: Operations.cc:39
void Starting::do_moveToFailedState ( xcept::Exception &  exception) const
privatevirtual

Implements stor::Operations.

Definition at line 71 of file Starting.cc.

72 {
73  outermost_context().getSharedResources()->alarmHandler_->moveToFailedState( exception );
74 }
void Starting::do_noFragmentToProcess ( ) const
privatevirtual

Reimplemented from stor::Operations.

Definition at line 87 of file Starting.cc.

References workerThreadsConfigured().

88 {
90  {
91  SharedResourcesPtr sharedResources =
92  outermost_context().getSharedResources();
93  EventPtr_t stMachEvent( new StartRun() );
94  sharedResources->commandQueue_->enqWait( stMachEvent );
95  }
96 }
boost::shared_ptr< SharedResources > SharedResourcesPtr
boost::shared_ptr< boost::statechart::event_base > EventPtr_t
Definition: CommandQueue.h:21
bool workerThreadsConfigured() const
Definition: Starting.cc:99
string Starting::do_stateName ( ) const
privatevirtual

Implements stor::Operations.

Definition at line 66 of file Starting.cc.

67 {
68  return std::string( "Starting" );
69 }
void Starting::logHaltDoneRequest ( const HaltDone request)

Definition at line 81 of file Starting.cc.

82 {
83  outermost_context().unconsumed_event( request );
84 }
void Starting::logStopDoneRequest ( const StopDone request)

Definition at line 76 of file Starting.cc.

77 {
78  outermost_context().unconsumed_event( request );
79 }
bool Starting::workerThreadsConfigured ( ) const
private

Definition at line 99 of file Starting.cc.

Referenced by do_noFragmentToProcess().

100 {
101  SharedResourcesPtr sharedResources =
102  outermost_context().getSharedResources();
103 
104  // check if the requests are still being processed
105  if ( sharedResources->diskWriterResources_->streamChangeOngoing() ) return false;
106 
107  if ( sharedResources->dqmEventProcessorResources_->requestsOngoing() ) return false;
108 
109  return true;
110 }
boost::shared_ptr< SharedResources > SharedResourcesPtr