CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Enabled.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
15 //______________________________________________________________________________
17 }
18 
20  SharedResourcesPtr_t res = outermost_context().getSharedResources();
21  LOG4CPLUS_INFO(res->log_, "--> ResourceBroker: NEW STATE: " << stateName());
22  outermost_context().setExternallyVisibleState(stateName());
23  outermost_context().setInternalStateName(stateName());
24  // notify RCMS of the new state
25  outermost_context().rcmsStateChangeNotify();
26 }
27 
28 // construction / destruction
29 //______________________________________________________________________________
30 Enabled::Enabled(my_context c) :
31  my_base(c) {
33 }
34 
37 }
38 
39 // exit action, state name, move to failed state
40 //______________________________________________________________________________
42 }
43 
44 string Enabled::do_stateName() const {
45  return string("Enabled");
46 }
47 
49  SharedResourcesPtr_t res = outermost_context().getSharedResources();
50  res->reasonForFailed_ = exception.what();
51  LOG4CPLUS_FATAL(res->log_,
52  "Moving to FAILED state! Reason: " << exception.what());
53  EventPtr fail(new Fail());
54  res->commands_.enqEvent(fail);
55 }
virtual void do_entryActionWork()
Definition: Enabled.cc:16
boost::shared_ptr< SharedResources > SharedResourcesPtr_t
reject
Definition: HLTenums.h:23
boost::shared_ptr< boost::statechart::event_base > EventPtr
Definition: CommandQueue.h:23
virtual void do_exitActionWork()
Definition: Enabled.cc:41
virtual void do_moveToFailedState(xcept::Exception &exception) const
Definition: Enabled.cc:48
virtual void do_stateNotify()
Definition: Enabled.cc:19
virtual std::string do_stateName() const
Definition: Enabled.cc:44
std::string stateName() const
Definition: BaseState.cc:31