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

#include <StateMachine.h>

Inheritance diagram for stor::Stopping:
stor::Operations

Public Types

typedef bsc::in_state_reaction
< HaltDone, Stopping,&Stopping::logHaltDoneRequest
HaltDoneIR
 
typedef boost::mpl::list
< HaltDoneIR
reactions
 

Public Member Functions

void logHaltDoneRequest (const HaltDone &request)
 
 Stopping (my_context)
 
virtual ~Stopping ()
 
- 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

bool destructionIsDone () const
 
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
 

Additional Inherited Members

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

Detailed Description

Stopping state

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

Definition at line 405 of file StateMachine.h.

Member Typedef Documentation

Definition at line 412 of file StateMachine.h.

Definition at line 413 of file StateMachine.h.

Constructor & Destructor Documentation

Stopping::Stopping ( my_context  c)

Definition at line 18 of file Stopping.cc.

References stor::Operations::safeEntryAction().

18  : my_base(c)
19 {
21 }
void safeEntryAction()
Definition: Operations.cc:77
Stopping::~Stopping ( )
virtual

Definition at line 41 of file Stopping.cc.

References stor::Operations::safeExitAction().

42 {
44 }
void safeExitAction()
Definition: Operations.cc:108

Member Function Documentation

bool Stopping::destructionIsDone ( ) const
private

Definition at line 80 of file Stopping.cc.

Referenced by do_noFragmentToProcess().

81 {
82  SharedResourcesPtr sharedResources =
83  outermost_context().getSharedResources();
84 
85  // check if the requests are still being processed
86  if ( sharedResources->diskWriterResources_->streamChangeOngoing() ) return false;
87 
88  if ( sharedResources->dqmEventProcessorResources_->requestsOngoing() ) return false;
89 
90  return true;
91 }
boost::shared_ptr< SharedResources > SharedResourcesPtr
void Stopping::do_entryActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 23 of file Stopping.cc.

References stor::Operations::stateName().

24 {
25 
26  TransitionRecord tr( stateName(), true );
27  outermost_context().updateHistory( tr );
28 
29  SharedResourcesPtr sharedResources =
30  outermost_context().getSharedResources();
31 
32  // request that the streams that are currently configured in the disk
33  // writer be destroyed (this has the side effect of closing files)
34  sharedResources->diskWriterResources_->requestStreamDestruction();
35 
36  // request that the DQM event store is cleared
37  // if FinishingDQM has succeeded, the store is already empty
38  sharedResources->dqmEventProcessorResources_->requestStoreDestruction();
39 }
std::string stateName() const
Definition: Operations.cc:39
boost::shared_ptr< SharedResources > SharedResourcesPtr
void Stopping::do_exitActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 46 of file Stopping.cc.

References stor::Operations::stateName().

47 {
48  TransitionRecord tr( stateName(), false );
49  outermost_context().updateHistory( tr );
50 }
std::string stateName() const
Definition: Operations.cc:39
void Stopping::do_moveToFailedState ( xcept::Exception &  exception) const
privatevirtual

Implements stor::Operations.

Definition at line 57 of file Stopping.cc.

58 {
59  outermost_context().getSharedResources()->alarmHandler_->moveToFailedState( exception );
60 }
void Stopping::do_noFragmentToProcess ( ) const
privatevirtual

Reimplemented from stor::Operations.

Definition at line 68 of file Stopping.cc.

References destructionIsDone().

69 {
70  if ( destructionIsDone() )
71  {
72  SharedResourcesPtr sharedResources =
73  outermost_context().getSharedResources();
74  EventPtr_t stMachEvent( new StopDone() );
75  sharedResources->commandQueue_->enqWait( stMachEvent );
76  }
77 }
bool destructionIsDone() const
Definition: Stopping.cc:80
boost::shared_ptr< SharedResources > SharedResourcesPtr
boost::shared_ptr< boost::statechart::event_base > EventPtr_t
Definition: CommandQueue.h:21
string Stopping::do_stateName ( ) const
privatevirtual

Implements stor::Operations.

Definition at line 52 of file Stopping.cc.

53 {
54  return std::string( "Stopping" );
55 }
void Stopping::logHaltDoneRequest ( const HaltDone request)

Definition at line 62 of file Stopping.cc.

63 {
64  outermost_context().unconsumed_event( request );
65 }