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

#include <StateMachine.h>

Inheritance diagram for stor::Halting:
stor::Operations

Public Types

typedef boost::mpl::list
< StopDoneIR
reactions
 
typedef bsc::in_state_reaction
< StopDone, Halting,&Halting::logStopDoneRequest
StopDoneIR
 

Public Member Functions

 Halting (my_context)
 
void logStopDoneRequest (const StopDone &request)
 
virtual ~Halting ()
 
- 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

Halting state

Author:
mommsen
Revision:
1.10.12.1
Date:
2011/03/07 11:33:04

Definition at line 437 of file StateMachine.h.

Member Typedef Documentation

Definition at line 445 of file StateMachine.h.

Definition at line 444 of file StateMachine.h.

Constructor & Destructor Documentation

Halting::Halting ( my_context  c)

Definition at line 18 of file Halting.cc.

References stor::Operations::safeEntryAction().

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

Definition at line 41 of file Halting.cc.

References stor::Operations::safeExitAction().

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

Member Function Documentation

bool Halting::destructionIsDone ( ) const
private

Definition at line 80 of file Halting.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 Halting::do_entryActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 23 of file Halting.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 Halting::do_exitActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 46 of file Halting.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 Halting::do_moveToFailedState ( xcept::Exception &  exception) const
privatevirtual

Implements stor::Operations.

Definition at line 57 of file Halting.cc.

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

Reimplemented from stor::Operations.

Definition at line 68 of file Halting.cc.

References destructionIsDone().

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

Implements stor::Operations.

Definition at line 52 of file Halting.cc.

53 {
54  return std::string( "Halting" );
55 }
void Halting::logStopDoneRequest ( const StopDone request)

Definition at line 62 of file Halting.cc.

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