CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Stopped.cc
Go to the documentation of this file.
1 
8 
9 #include <iostream>
10 
11 using std::string;
12 using namespace evf::rb_statemachine;
13 
14 // entry action, state notification, state action
15 //______________________________________________________________________________
17 }
18 
20  /*
21  * Stopped will set the externally visible state to ready.
22  * (useful when re-entering Stopped after a _stop_ event)
23  */
24  SharedResourcesPtr_t res = outermost_context().getSharedResources();
25  LOG4CPLUS_INFO(res->log_, "--> ResourceBroker: NEW STATE: " << stateName());
26  outermost_context().setExternallyVisibleState("Ready");
27  outermost_context().setInternalStateName(stateName());
28  // notify RCMS of the new state
29  outermost_context().rcmsStateChangeNotify();
30 }
31 
32 // construction / destruction
33 //______________________________________________________________________________
34 Stopped::Stopped(my_context c) :
35  my_base(c) {
37 }
38 
41 }
42 
43 // exit action, state name, move to failed state
44 //______________________________________________________________________________
46 }
47 
48 string Stopped::do_stateName() const {
49  return string("Stopped");
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: Stopped.cc:48
virtual void do_exitActionWork()
Definition: Stopped.cc:45
virtual void do_entryActionWork()
Definition: Stopped.cc:16
virtual void do_stateNotify()
Definition: Stopped.cc:19
virtual void do_moveToFailedState(xcept::Exception &exception) const
Definition: Stopped.cc:52
std::string stateName() const
Definition: BaseState.cc:31