diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-07-05 08:05:55 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2017-07-05 08:05:55 (GMT) |
commit | bfefa5fd44b9ed1491612f26b099db8ad624247b (patch) | |
tree | ca4313ced9adb3288056c3e7ddf121e614cf3c2b /src/bindings | |
parent | 04121c58222c95b1d808a1556b5110832a1c1119 (diff) | |
download | uscxml-bfefa5fd44b9ed1491612f26b099db8ad624247b.zip uscxml-bfefa5fd44b9ed1491612f26b099db8ad624247b.tar.gz uscxml-bfefa5fd44b9ed1491612f26b099db8ad624247b.tar.bz2 |
More performant Monitors
Breaks InterpreterMonitor API, Interpreter argument is substituted by sessionId. Use Intererpreter::fromSessionId to retrieve actual session when required.
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp | 32 | ||||
-rw-r--r-- | src/bindings/swig/wrapped/WrappedInterpreterMonitor.h | 44 |
2 files changed, 41 insertions, 35 deletions
diff --git a/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp index 03b52bc..2c501a1 100644 --- a/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp +++ b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.cpp @@ -30,31 +30,31 @@ using namespace XERCESC_NS; WrappedInterpreterMonitor::WrappedInterpreterMonitor() {} WrappedInterpreterMonitor::~WrappedInterpreterMonitor() {} -void WrappedInterpreterMonitor::beforeExitingState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state) { +void WrappedInterpreterMonitor::beforeExitingState(const std::string& sessionId, const std::string& stateId, const XERCESC_NS::DOMElement* state) { std::stringstream ss; ss << *state; - beforeExitingState(ATTR(state, kXMLCharId), DOMUtils::xPathForNode(state), ss.str()); + beforeExitingState(stateId, DOMUtils::xPathForNode(state), ss.str()); } -void WrappedInterpreterMonitor::afterExitingState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state) { +void WrappedInterpreterMonitor::afterExitingState(const std::string& sessionId, const std::string& stateId, const XERCESC_NS::DOMElement* state) { std::stringstream ss; ss << *state; - afterExitingState(ATTR(state, kXMLCharId), DOMUtils::xPathForNode(state), ss.str()); + afterExitingState(stateId, DOMUtils::xPathForNode(state), ss.str()); } -void WrappedInterpreterMonitor::beforeExecutingContent(Interpreter& interpreter, const XERCESC_NS::DOMElement* content) { +void WrappedInterpreterMonitor::beforeExecutingContent(const std::string& sessionId, const XERCESC_NS::DOMElement* content) { std::stringstream ss; ss << *content; beforeExecutingContent(TAGNAME(content), DOMUtils::xPathForNode(content), ss.str()); } -void WrappedInterpreterMonitor::afterExecutingContent(Interpreter& interpreter, const XERCESC_NS::DOMElement* content) { +void WrappedInterpreterMonitor::afterExecutingContent(const std::string& sessionId, const XERCESC_NS::DOMElement* content) { std::stringstream ss; ss << *content; afterExecutingContent(TAGNAME(content), DOMUtils::xPathForNode(content), ss.str()); } -void WrappedInterpreterMonitor::beforeUninvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { +void WrappedInterpreterMonitor::beforeUninvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { std::stringstream ss; ss << *invoker; std::string invokeId; @@ -65,7 +65,7 @@ void WrappedInterpreterMonitor::beforeUninvoking(Interpreter& interpreter, const beforeUninvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str()); } -void WrappedInterpreterMonitor::afterUninvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { +void WrappedInterpreterMonitor::afterUninvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { std::stringstream ss; ss << *invoker; std::string invokeId; @@ -76,7 +76,7 @@ void WrappedInterpreterMonitor::afterUninvoking(Interpreter& interpreter, const afterUninvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str()); } -void WrappedInterpreterMonitor::beforeTakingTransition(Interpreter& interpreter, const XERCESC_NS::DOMElement* transition) { +void WrappedInterpreterMonitor::beforeTakingTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition) { XERCESC_NS::DOMElement* sourceState = getSourceState(transition); const XERCESC_NS::DOMElement* root = DOMUtils::getNearestAncestor(transition, "scxml"); @@ -93,7 +93,7 @@ void WrappedInterpreterMonitor::beforeTakingTransition(Interpreter& interpreter, beforeTakingTransition(DOMUtils::xPathForNode(transition), ATTR_CAST(sourceState, kXMLCharId), targets, ss.str()); } -void WrappedInterpreterMonitor::afterTakingTransition(Interpreter& interpreter, const XERCESC_NS::DOMElement* transition) { +void WrappedInterpreterMonitor::afterTakingTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition) { XERCESC_NS::DOMElement* sourceState = getSourceState(transition); const XERCESC_NS::DOMElement* root = DOMUtils::getNearestAncestor(transition, "scxml"); @@ -110,19 +110,19 @@ void WrappedInterpreterMonitor::afterTakingTransition(Interpreter& interpreter, afterTakingTransition(DOMUtils::xPathForNode(transition), ATTR_CAST(sourceState, kXMLCharId), targets, ss.str()); } -void WrappedInterpreterMonitor::beforeEnteringState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state) { +void WrappedInterpreterMonitor::beforeEnteringState(const std::string& sessionId, const std::string& stateId, const XERCESC_NS::DOMElement* state) { std::stringstream ss; ss << *state; - beforeEnteringState(ATTR(state, kXMLCharId), DOMUtils::xPathForNode(state), ss.str()); + beforeEnteringState(stateId, DOMUtils::xPathForNode(state), ss.str()); } -void WrappedInterpreterMonitor::afterEnteringState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state) { +void WrappedInterpreterMonitor::afterEnteringState(const std::string& sessionId, const std::string& stateId, const XERCESC_NS::DOMElement* state) { std::stringstream ss; ss << *state; - afterEnteringState(ATTR(state, kXMLCharId), DOMUtils::xPathForNode(state), ss.str()); + afterEnteringState(stateId, DOMUtils::xPathForNode(state), ss.str()); } -void WrappedInterpreterMonitor::beforeInvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { +void WrappedInterpreterMonitor::beforeInvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { std::stringstream ss; ss << *invoker; std::string invokeId; @@ -133,7 +133,7 @@ void WrappedInterpreterMonitor::beforeInvoking(Interpreter& interpreter, const X beforeInvoking(DOMUtils::xPathForNode(invoker), invokeId, ss.str()); } -void WrappedInterpreterMonitor::afterInvoking(Interpreter& interpreter, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { +void WrappedInterpreterMonitor::afterInvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid) { std::stringstream ss; ss << *invoker; std::string invokeId; diff --git a/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h index 697a420..cd4404b 100644 --- a/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h +++ b/src/bindings/swig/wrapped/WrappedInterpreterMonitor.h @@ -44,34 +44,38 @@ public: WrappedInterpreterMonitor(); virtual ~WrappedInterpreterMonitor(); - virtual void beforeProcessingEvent(Interpreter& interpreter, const Event& event) {} - virtual void beforeMicroStep(Interpreter& interpreter) {} + virtual void beforeProcessingEvent(const std::string& sessionId, const Event& event) {} + virtual void beforeMicroStep(const std::string& sessionId) {} - void beforeExitingState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state); + void beforeExitingState(const std::string& sessionId, + const std::string& stateId, + const XERCESC_NS::DOMElement* state); virtual void beforeExitingState(const std::string& stateId, const std::string& xpath, const std::string& stateXML) {} - void afterExitingState(Interpreter& interpreter, const XERCESC_NS::DOMElement* state); + void afterExitingState(const std::string& sessionId, + const std::string& stateId, + const XERCESC_NS::DOMElement* state); virtual void afterExitingState(const std::string& stateId, const std::string& xpath, const std::string& stateXML) {} - void beforeExecutingContent(Interpreter& interpreter, const XERCESC_NS::DOMElement* content); + void beforeExecutingContent(const std::string& sessionId, const XERCESC_NS::DOMElement* content); virtual void beforeExecutingContent(const std::string& tagName, const std::string& xpath, const std::string& contentXML) {} - void afterExecutingContent(Interpreter& interpreter, const XERCESC_NS::DOMElement* content); + void afterExecutingContent(const std::string& sessionId, const XERCESC_NS::DOMElement* content); virtual void afterExecutingContent(const std::string& tagName, const std::string& xpath, const std::string& contentXML) {} - void beforeUninvoking(Interpreter& interpreter, + void beforeUninvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid); virtual void beforeUninvoking(const std::string& xpath, @@ -79,7 +83,7 @@ public: const std::string& invokerXML) {} - void afterUninvoking(Interpreter& interpreter, + void afterUninvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid); virtual void afterUninvoking(const std::string& xpath, @@ -87,14 +91,14 @@ public: const std::string& invokerXML) {} - void beforeTakingTransition(Interpreter& interpreter, + void beforeTakingTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition); virtual void beforeTakingTransition(const std::string& xpath, const std::string& source, const std::list<std::string>& targets, const std::string& transitionXML) {} - void afterTakingTransition(Interpreter& interpreter, + void afterTakingTransition(const std::string& sessionId, const XERCESC_NS::DOMElement* transition); virtual void afterTakingTransition(const std::string& xpath, const std::string& source, @@ -102,41 +106,43 @@ public: const std::string& transitionXML) {} - void beforeEnteringState(Interpreter& interpreter, + void beforeEnteringState(const std::string& sessionId, + const std::string& stateId, const XERCESC_NS::DOMElement* state); virtual void beforeEnteringState(const std::string& stateId, const std::string& xpath, const std::string& stateXML) {} - void afterEnteringState(Interpreter& interpreter, + void afterEnteringState(const std::string& sessionId, + const std::string& stateId, const XERCESC_NS::DOMElement* state); virtual void afterEnteringState(const std::string& stateId, const std::string& xpath, const std::string& stateXML) {} - void beforeInvoking(Interpreter& interpreter, + void beforeInvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid); virtual void beforeInvoking(const std::string& xpath, const std::string& invokeid, const std::string& invokerXML) {} - void afterInvoking(Interpreter& interpreter, + void afterInvoking(const std::string& sessionId, const XERCESC_NS::DOMElement* invoker, const std::string& invokeid); virtual void afterInvoking(const std::string& xpath, const std::string& invokeid, const std::string& invokerXML) {} - virtual void afterMicroStep(Interpreter& interpreter) {} - virtual void onStableConfiguration(Interpreter& interpreter) {} + virtual void afterMicroStep(const std::string& sessionId) {} + virtual void onStableConfiguration(const std::string& sessionId) {} - virtual void beforeCompletion(Interpreter& interpreter) {} - virtual void afterCompletion(Interpreter& interpreter) {} + virtual void beforeCompletion(const std::string& sessionId) {} + virtual void afterCompletion(const std::string& sessionId) {} - virtual void reportIssue(Interpreter& interpreter, + virtual void reportIssue(const std::string& sessionId, const InterpreterIssue& issue) {} }; |