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

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 17 of file Stopping.cc.

References stor::Operations::safeEntryAction().

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

Definition at line 40 of file Stopping.cc.

References stor::Operations::safeExitAction().

41 {
43 }
void safeExitAction()
Definition: Operations.cc:108

Member Function Documentation

bool Stopping::destructionIsDone ( ) const
private

Definition at line 79 of file Stopping.cc.

Referenced by do_noFragmentToProcess().

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

Implements stor::Operations.

Definition at line 22 of file Stopping.cc.

References stor::Operations::stateName().

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

Implements stor::Operations.

Definition at line 45 of file Stopping.cc.

References stor::Operations::stateName().

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

Implements stor::Operations.

Definition at line 56 of file Stopping.cc.

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

Reimplemented from stor::Operations.

Definition at line 67 of file Stopping.cc.

References destructionIsDone().

68 {
69  if ( destructionIsDone() )
70  {
71  SharedResourcesPtr sharedResources =
72  outermost_context().getSharedResources();
73  EventPtr_t stMachEvent( new StopDone() );
74  sharedResources->commandQueue_->enqWait( stMachEvent );
75  }
76 }
bool destructionIsDone() const
Definition: Stopping.cc:79
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 51 of file Stopping.cc.

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

Definition at line 61 of file Stopping.cc.

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