#include <EPStateMachine.h>
|
xoap::MessageReference | createFSMReplyMsg (const std::string cmd, const std::string state) |
|
| EPStateMachine (log4cplus::Logger &logger) |
|
void | failedTransition (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception) |
|
void | fireEvent (toolbox::Event::Reference e) throw (toolbox::fsm::exception::Exception) |
|
template<class T > |
void | init (T *me) |
|
xoap::MessageReference | processFSMCommand (const std::string cmdName) throw (xoap::exception::Exception) |
|
void | reset () throw (toolbox::fsm::exception::Exception) |
|
void | stateChanged (toolbox::fsm::FiniteStateMachine &fsm) throw (toolbox::fsm::exception::Exception) |
|
Definition at line 15 of file EPStateMachine.h.
evf::EPStateMachine::EPStateMachine |
( |
log4cplus::Logger & |
logger | ) |
|
xoap::MessageReference evf::EPStateMachine::createFSMReplyMsg |
( |
const std::string |
cmd, |
|
|
const std::string |
state |
|
) |
| |
Definition at line 33 of file EPStateMachine.cc.
References runTheMatrix::msg.
36 xoap::MessageReference
msg = xoap::createMessage();
37 xoap::SOAPEnvelope env = msg->getSOAPPart().getEnvelope();
38 xoap::SOAPBody body = env.getBody();
39 std::string rStr =
cmd +
"Response";
40 xoap::SOAPName rName = env.createName(rStr,
"xdaq",XDAQ_NS_URI);
41 xoap::SOAPBodyElement rElem = body.addBodyElement(rName);
42 xoap::SOAPName sName = env.createName(
"state",
"xdaq",XDAQ_NS_URI);
43 xoap::SOAPElement sElem = rElem.addChildElement(sName);
44 xoap::SOAPName aName = env.createName(
"stateName",
"xdaq",XDAQ_NS_URI);
47 sElem.addAttribute(aName,
state);
void evf::EPStateMachine::failedTransition |
( |
toolbox::Event::Reference |
e | ) |
|
throw | ( | toolbox::fsm::exception::Exception |
| ) | | |
|
inline |
Definition at line 68 of file EPStateMachine.h.
References logger_.
Referenced by init().
71 toolbox::fsm::FailedEvent &fe =
72 dynamic_cast<toolbox::fsm::FailedEvent&
>(*e);
75 "Failure occurred when performing transition from: "
76 << fe.getFromState() <<
" to: " << fe.getToState()
77 <<
" exception: " << fe.getException().what());
log4cplus::Logger & logger_
void evf::EPStateMachine::fireEvent |
( |
toolbox::Event::Reference |
e | ) |
|
throw | ( | toolbox::fsm::exception::Exception |
| ) | | |
|
inline |
Calls FiniteStateMachine::fireEvent() and keeps stateName_ and state_ in sync.
Definition at line 106 of file EPStateMachine.h.
References edm::hlt::Exception, logger_, state_, and stateName_.
110 FiniteStateMachine::fireEvent(e);
114 LOG4CPLUS_ERROR(
logger_,
"EPStateMachine fireEvent failed "
119 LOG4CPLUS_ERROR(
logger_,
"EPStateMachine fireEvent failed "
120 <<
" Unknown Exception " <<
" state is "
121 << FiniteStateMachine::getCurrentState());
125 state_ = FiniteStateMachine::getCurrentState();
toolbox::fsm::State state_
log4cplus::Logger & logger_
template<class T >
void evf::EPStateMachine::init |
( |
T * |
me | ) |
|
|
inline |
Definition at line 32 of file EPStateMachine.h.
References failedTransition(), reset(), and stateChanged().
Referenced by dqm::StateMachine::StateMachine().
41 addStateTransition(
'H',
'R',
"Configure", me, &T::configureAction);
42 addStateTransition(
'R',
'E',
"Enable", me, &T::enableAction);
43 addStateTransition(
'E',
'R',
"Stop", me, &T::stopAction);
44 addStateTransition(
'E',
'S',
"Suspend", me, &T::suspendAction);
45 addStateTransition(
'S',
'E',
"Resume", me, &T::resumeAction);
46 addStateTransition(
'H',
'H',
"Halt", me, &T::nullAction);
47 addStateTransition(
'R',
'H',
"Halt", me, &T::haltAction);
48 addStateTransition(
'E',
'H',
"Halt", me, &T::haltAction);
49 addStateTransition(
'S',
'H',
"Halt", me, &T::haltAction);
57 xoap::bind(me,&T::fireEvent,
"Configure", XDAQ_NS_URI);
58 xoap::bind(me,&T::fireEvent,
"Stop" , XDAQ_NS_URI);
59 xoap::bind(me,&T::fireEvent,
"Enable" , XDAQ_NS_URI);
60 xoap::bind(me,&T::fireEvent,
"Suspend" , XDAQ_NS_URI);
61 xoap::bind(me,&T::fireEvent,
"Resume" , XDAQ_NS_URI);
62 xoap::bind(me,&T::fireEvent,
"Halt" , XDAQ_NS_URI);
63 xoap::bind(me,&T::fireEvent,
"Disable" , XDAQ_NS_URI);
64 xoap::bind(me,&T::fireEvent,
"Fail" , XDAQ_NS_URI);
void failedTransition(toolbox::Event::Reference e)
void stateChanged(toolbox::fsm::FiniteStateMachine &fsm)
xoap::MessageReference evf::EPStateMachine::processFSMCommand |
( |
const std::string |
cmdName | ) |
|
throw | ( | xoap::exception::Exception |
| ) | | |
Definition at line 12 of file EPStateMachine.cc.
References edm::hlt::Exception.
Referenced by dqm::StateMachine::dispatch().
18 toolbox::Event::Reference evtRef(
new toolbox::Event(cmdName,
this));
25 "Failed to process " + cmdName, e);
30 "Failed to process " + cmdName +
" - Unknown exception");
void fireEvent(toolbox::Event::Reference e)
xoap::MessageReference createFSMReplyMsg(const std::string cmd, const std::string state)
void evf::EPStateMachine::reset |
( |
void |
| ) |
|
throw | ( | toolbox::fsm::exception::Exception |
| ) | | |
|
inline |
Calls FiniteStateMachine::reset() and keeps stateName_ and state_ in sync.
Definition at line 93 of file EPStateMachine.h.
References reset(), state_, and stateName_.
Referenced by init().
97 state_ = FiniteStateMachine::getCurrentState();
toolbox::fsm::State state_
void reset(double vett[256])
void evf::EPStateMachine::stateChanged |
( |
toolbox::fsm::FiniteStateMachine & |
fsm | ) |
|
throw | ( | toolbox::fsm::exception::Exception |
| ) | | |
|
inline |
Definition at line 80 of file EPStateMachine.h.
References logger_.
Referenced by init().
85 << getStateName(getCurrentState()));
log4cplus::Logger & logger_
log4cplus::Logger& evf::EPStateMachine::logger_ |
|
private |
toolbox::fsm::State evf::EPStateMachine::state_ |
xdata::String evf::EPStateMachine::stateName_ |