CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BaseState.cc
Go to the documentation of this file.
1 //
3 // BaseState
4 // -------
5 //
6 // Superclass of all FSM states.
7 //
8 // 20/01/2012 Andrei Spataru <aspataru@cern.ch>
10 
14 
15 #include <boost/statechart/event_base.hpp>
16 
17 #include <iostream>
18 
19 using std::string;
20 using std::cout;
21 using std::endl;
22 using namespace boost::statechart;
23 using namespace evf::rb_statemachine;
24 
25 BaseState::BaseState() {
26 }
27 
28 BaseState::~BaseState() {
29 }
30 
31 string BaseState::stateName() const {
32  return do_stateName();
33 }
34 
35 void BaseState::moveToFailedState(xcept::Exception& exception) const {
36  do_moveToFailedState(exception);
37 }
38 
40 // Default implementation for entry / exit action virtual functions.
42 
43 void BaseState::safeEntryAction() {
44  string errmsg = "Error going into requested state!";
45  try {
46  do_entryActionWork();
47  } catch (xcept::Exception& e) {
48  XCEPT_RETHROW(evf::Exception, errmsg, e);
49  }
50 }
51 
52 void BaseState::safeExitAction() {
53  string errmsg = "Error leaving current state!";
54  try {
55  do_exitActionWork();
56  } catch (xcept::Exception& e) {
57  XCEPT_RETHROW(evf::Exception, errmsg, e);
58  }
59 }
tuple cout
Definition: gather_cfg.py:121