CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Running.cc
Go to the documentation of this file.
1 
8 
9 #include "interface/evb/i2oEVBMsgs.h"
10 
11 #include <iostream>
12 
13 using std::string;
14 using std::cout;
15 using std::endl;
16 using namespace evf::rb_statemachine;
17 
18 // entry action, state notification, state action
19 //______________________________________________________________________________
21 }
22 
24  SharedResourcesPtr_t res = outermost_context().getSharedResources();
25  LOG4CPLUS_INFO(res->log_, "--> ResourceBroker: NEW STATE: " << stateName());
26  outermost_context().setExternallyVisibleState("Enabled");
27  outermost_context().setInternalStateName(stateName());
28  // notify RCMS of the new state
29  outermost_context().rcmsStateChangeNotify();
30 }
31 
33  outermost_context().getSharedResources()->resourceStructure_->setStopFlag(false);
34 }
35 
36 /*
37  * Supported I2O operations
38  */
39 
40 bool Running::discardDataEvent(MemRef_t* bufRef) const {
41  SharedResourcesPtr_t res = outermost_context().getSharedResources();
42  bool returnValue = false;
43  try {
44  returnValue = res->resourceStructure_->discardDataEvent(bufRef);
45  } catch (evf::Exception& e) {
47  }
48  return returnValue;
49 }
50 bool Running::discardDqmEvent(MemRef_t* bufRef) const {
51  SharedResourcesPtr_t res = outermost_context().getSharedResources();
52  bool returnValue = false;
53  try {
54  returnValue = res->resourceStructure_->discardDqmEvent(bufRef);
55  } catch (evf::Exception& e) {
57  }
58  return returnValue;
59 }
60 
61 // construction / destruction
62 //______________________________________________________________________________
63 Running::Running(my_context c) :
64  my_base(c) {
66 }
67 
70 }
71 
72 // exit action, state name, move to failed state
73 //______________________________________________________________________________
75 }
76 
77 string Running::do_stateName() const {
78  return string("Running");
79 }
80 
82  SharedResourcesPtr_t res = outermost_context().getSharedResources();
83  res->reasonForFailed_ = exception.what();
84  LOG4CPLUS_FATAL(res->log_,
85  "Moving to FAILED state! Reason: " << exception.what());
86  EventPtr fail(new Fail());
87  res->commands_.enqEvent(fail);
88 
89 }
virtual bool discardDqmEvent(MemRef_t *bufRef) const
Definition: Running.cc:50
boost::shared_ptr< SharedResources > SharedResourcesPtr_t
toolbox::mem::Reference MemRef_t
Definition: FUTypes.h:10
virtual bool discardDataEvent(MemRef_t *bufRef) const
Definition: Running.cc:40
reject
Definition: HLTenums.h:23
boost::shared_ptr< boost::statechart::event_base > EventPtr
Definition: CommandQueue.h:23
virtual void do_stateAction() const
Definition: Running.cc:32
virtual void do_stateNotify()
Definition: Running.cc:23
virtual std::string do_stateName() const
Definition: Running.cc:77
virtual void do_entryActionWork()
Definition: Running.cc:20
void moveToFailedState(xcept::Exception &exception) const
Definition: BaseState.cc:35
virtual void do_moveToFailedState(xcept::Exception &exception) const
Definition: Running.cc:81
virtual void do_exitActionWork()
Definition: Running.cc:74
tuple cout
Definition: gather_cfg.py:121
std::string stateName() const
Definition: BaseState.cc:31