CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Halted.cc
Go to the documentation of this file.
1 
8 
9 using std::string;
10 using namespace evf::rb_statemachine;
11 
12 // entry action, state notification, state action
13 //______________________________________________________________________________
15  if (outermost_context().firstTimeInHalted())
16  // set states, not RCMS notification
17  //do_stateNotify();
18  outermost_context().setExternallyVisibleState(do_stateName());
19  outermost_context().setInternalStateName(do_stateName());
20 }
21 
23  SharedResourcesPtr_t res = outermost_context().getSharedResources();
24  LOG4CPLUS_INFO(res->log_, "--> ResourceBroker: NEW STATE: " << stateName());
25  outermost_context().setExternallyVisibleState(stateName());
26  outermost_context().setInternalStateName(stateName());
27  // notify RCMS of the new state
28  outermost_context().rcmsStateChangeNotify();
29 }
30 
31 // construction / destruction
32 //______________________________________________________________________________
33 Halted::Halted(my_context c) :
34  my_base(c) {
36 }
37 
40 }
41 
42 // exit action, state name, move to failed state
43 //______________________________________________________________________________
45  outermost_context().setFirstTimeInHaltedFalse();
46 }
47 
48 string Halted::do_stateName() const {
49  return string("Halted");
50 }
51 
53  SharedResourcesPtr_t res = outermost_context().getSharedResources();
54  res->reasonForFailed_ = exception.what();
55  LOG4CPLUS_FATAL(res->log_,
56  "Moving to FAILED state! Reason: " << exception.what());
57  EventPtr fail(new Fail());
58  res->commands_.enqEvent(fail);
59 }
boost::shared_ptr< SharedResources > SharedResourcesPtr_t
reject
Definition: HLTenums.h:23
boost::shared_ptr< boost::statechart::event_base > EventPtr
Definition: CommandQueue.h:23
virtual std::string do_stateName() const
Definition: Halted.cc:48
virtual void do_entryActionWork()
Definition: Halted.cc:14
virtual void do_exitActionWork()
Definition: Halted.cc:44
virtual void do_moveToFailedState(xcept::Exception &exception) const
Definition: Halted.cc:52
virtual void do_stateNotify()
Definition: Halted.cc:22
std::string stateName() const
Definition: BaseState.cc:31