CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions
stor::Operations Class Referenceabstract

#include <StateMachine.h>

Inheritance diagram for stor::Operations:
stor::Constructed stor::DrainingQueues stor::Enabled stor::Failed stor::FinishingDQM stor::Halted stor::Halting stor::Normal stor::Processing stor::Ready stor::Running stor::Starting stor::Stopped stor::Stopping

Public Member Functions

void moveToFailedState (xcept::Exception &exception) const
 
void noFragmentToProcess () const
 
 Operations ()
 
void processI2OFragment (I2OChain &frag) const
 
std::string stateName () const
 
virtual ~Operations ()=0
 

Protected Member Functions

virtual void do_entryActionWork ()=0
 
virtual void do_exitActionWork ()=0
 
virtual void do_moveToFailedState (xcept::Exception &exception) const =0
 
virtual void do_noFragmentToProcess () const
 
virtual void do_processI2OFragment (I2OChain &frag) const
 
virtual std::string do_stateName () const =0
 
void safeEntryAction ()
 
void safeExitAction ()
 

Detailed Description

Abstract base for state classes

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

Definition at line 85 of file StateMachine.h.

Constructor & Destructor Documentation

Operations::Operations ( )

Definition at line 17 of file Operations.cc.

18 {
19  //TransitionRecord tr( stateName(), true );
20  //outermost_context().updateHistory( tr );
21 }
Operations::~Operations ( )
pure virtual

Definition at line 23 of file Operations.cc.

24 {
25  //TransitionRecord tr( stateName(), false );
26  //outermost_context().updateHistory( tr );
27 }

Member Function Documentation

virtual void stor::Operations::do_entryActionWork ( )
protectedpure virtual
virtual void stor::Operations::do_exitActionWork ( )
protectedpure virtual
virtual void stor::Operations::do_moveToFailedState ( xcept::Exception &  exception) const
protectedpure virtual
void Operations::do_noFragmentToProcess ( ) const
protectedvirtual

Reimplemented in stor::FinishingDQM, stor::DrainingQueues, stor::Processing, stor::Halting, stor::Stopping, and stor::Starting.

Definition at line 140 of file Operations.cc.

141 {
142  //std::cout << stateName() << "::noFragmentToProcess()" << std::endl;
143 }
void Operations::do_processI2OFragment ( I2OChain frag) const
protectedvirtual

Reimplemented in stor::Processing.

Definition at line 55 of file Operations.cc.

56 {
57  //std::cout << stateName() << "::processI2OFragment()" << std::endl;
58 
59  // 20-Mar-2009, KAB: if we get a fragment when we are not supposed to get
60  // one, should we still send a discard message to the resource broker?
61  // If we don't, couldn't that cause problems upstream? If we do, though,
62  // we could end up sending duplicate discard messages (one per fragment).
63  // At a minimum, we should make sure that we don't try to use the discard
64  // manager before it is available.
65  // Of course, if we want to do this, we need to implement a way to get
66  // a handle to the discard manager since outermost_context() doesn't
67  // actually work here.
68  //
69  //if ( outermost_context().getSharedResources().get() != 0 &&
70  // outermost_context().getSharedResources()->discardManager_.get() != 0)
71  // {
72  // outermost_context().getSharedResources()->discardManager_->sendDiscardMessage(frag);
73  // }
74 }
virtual std::string stor::Operations::do_stateName ( ) const
protectedpure virtual
void Operations::moveToFailedState ( xcept::Exception &  exception) const

Definition at line 44 of file Operations.cc.

45 {
47 }
virtual void do_moveToFailedState(xcept::Exception &exception) const =0
void Operations::noFragmentToProcess ( ) const

Definition at line 34 of file Operations.cc.

Referenced by stor::Processing::do_processI2OFragment().

35 {
37 }
virtual void do_noFragmentToProcess() const
Definition: Operations.cc:140
void Operations::processI2OFragment ( I2OChain frag) const

Definition at line 29 of file Operations.cc.

30 {
31  do_processI2OFragment( frag );
32 }
virtual void do_processI2OFragment(I2OChain &frag) const
Definition: Operations.cc:55
void Operations::safeEntryAction ( )
protected

Definition at line 77 of file Operations.cc.

References ExpressReco_HICollisions_FallBack::e, cmsCodeRules.cppFunctionSkipper::exception, edm::hlt::Exception, runTheMatrix::msg, and susybsm::HSCParticleType::unknown.

Referenced by stor::Constructed::Constructed(), stor::DrainingQueues::DrainingQueues(), stor::Enabled::Enabled(), stor::Failed::Failed(), stor::FinishingDQM::FinishingDQM(), stor::Halted::Halted(), stor::Halting::Halting(), stor::Normal::Normal(), stor::Processing::Processing(), stor::Ready::Ready(), stor::Running::Running(), stor::Starting::Starting(), stor::Stopped::Stopped(), and stor::Stopping::Stopping().

78 {
79  const std::string unknown = "unknown exception";
80  std::string msg = "Error going into " + stateName() + " state: ";
81  try
82  {
84  }
85  catch( xcept::Exception& e )
86  {
87  XCEPT_DECLARE_NESTED( stor::exception::StateTransition,
88  sentinelException, msg, e );
89  moveToFailedState( sentinelException );
90  }
91  catch( std::exception& e )
92  {
93  msg += e.what();
94  XCEPT_DECLARE( stor::exception::StateTransition,
95  sentinelException, msg );
96  moveToFailedState( sentinelException );
97  }
98  catch(...)
99  {
100  msg += "unknown exception";
101  XCEPT_DECLARE( stor::exception::StateTransition,
102  sentinelException, msg );
103  moveToFailedState( sentinelException );
104  }
105 }
std::string stateName() const
Definition: Operations.cc:39
void moveToFailedState(xcept::Exception &exception) const
Definition: Operations.cc:44
virtual void do_entryActionWork()=0
void Operations::safeExitAction ( )
protected

Definition at line 108 of file Operations.cc.

References ExpressReco_HICollisions_FallBack::e, cmsCodeRules.cppFunctionSkipper::exception, edm::hlt::Exception, runTheMatrix::msg, and susybsm::HSCParticleType::unknown.

Referenced by stor::Constructed::~Constructed(), stor::DrainingQueues::~DrainingQueues(), stor::Enabled::~Enabled(), stor::Failed::~Failed(), stor::FinishingDQM::~FinishingDQM(), stor::Halted::~Halted(), stor::Halting::~Halting(), stor::Normal::~Normal(), stor::Processing::~Processing(), stor::Ready::~Ready(), stor::Running::~Running(), stor::Starting::~Starting(), stor::Stopped::~Stopped(), and stor::Stopping::~Stopping().

109 {
110  const std::string unknown = "unknown exception";
111  std::string msg = "Error leaving " + stateName() + " state: ";
112  try
113  {
115  }
116  catch( xcept::Exception& e )
117  {
118  XCEPT_DECLARE_NESTED( stor::exception::StateTransition,
119  sentinelException, msg, e );
120  moveToFailedState( sentinelException );
121  }
122  catch( std::exception& e )
123  {
124  msg += e.what();
125  XCEPT_DECLARE( stor::exception::StateTransition,
126  sentinelException, msg );
127  moveToFailedState( sentinelException );
128  }
129  catch(...)
130  {
131  msg += "unknown exception";
132  XCEPT_DECLARE( stor::exception::StateTransition,
133  sentinelException, msg );
134  moveToFailedState( sentinelException );
135  }
136 }
std::string stateName() const
Definition: Operations.cc:39
void moveToFailedState(xcept::Exception &exception) const
Definition: Operations.cc:44
virtual void do_exitActionWork()=0
std::string Operations::stateName ( ) const