diff options
author | Stefan Radomski <github@mintwerk.de> | 2017-07-05 11:35:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-05 11:35:04 (GMT) |
commit | cb2f533085542a753fc45d17fdb09396c46fbadc (patch) | |
tree | 66d378d1df7cb82834e944a1f37865809abf75ae /src/uscxml/interpreter/FastMicroStep.cpp | |
parent | 3f10e11d6ad2b97fee4aee6e09bc959ba9b8e0e5 (diff) | |
parent | a0f96c5dd050c524223ac644ba8798bc7cc80bfd (diff) | |
download | uscxml-cb2f533085542a753fc45d17fdb09396c46fbadc.zip uscxml-cb2f533085542a753fc45d17fdb09396c46fbadc.tar.gz uscxml-cb2f533085542a753fc45d17fdb09396c46fbadc.tar.bz2 |
Merge pull request #155 from tklab-tud/sradomski
More performant monitors with slight API break
Diffstat (limited to 'src/uscxml/interpreter/FastMicroStep.cpp')
-rw-r--r-- | src/uscxml/interpreter/FastMicroStep.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/uscxml/interpreter/FastMicroStep.cpp b/src/uscxml/interpreter/FastMicroStep.cpp index 8b91191..d6ad298 100644 --- a/src/uscxml/interpreter/FastMicroStep.cpp +++ b/src/uscxml/interpreter/FastMicroStep.cpp @@ -269,6 +269,9 @@ void FastMicroStep::init(XERCESC_NS::DOMElement* scxml) { _states[i] = new State(); _states[i]->documentOrder = i; _states[i]->element = tmp.front(); + if (HAS_ATTR(_states[i]->element, kXMLCharId)) { + _states[i]->name = ATTR(_states[i]->element, kXMLCharId); + } _states[i]->element->setUserData(X("uscxmlState"), _states[i], NULL); _states[i]->completion.resize(_states.size()); _states[i]->ancestors.resize(_states.size()); @@ -995,7 +998,7 @@ ESTABLISH_ENTRYSET: while(i-- > 0) { if (BIT_HAS(i, _exitSet) && BIT_HAS(i, _configuration)) { - USCXML_MONITOR_CALLBACK1(monitors, beforeExitingState, USCXML_GET_STATE(i).element); + USCXML_MONITOR_CALLBACK2(monitors, beforeExitingState, USCXML_GET_STATE(i).name, USCXML_GET_STATE(i).element); /* call all on exit handlers */ for (auto exitIter = USCXML_GET_STATE(i).onExit.begin(); exitIter != USCXML_GET_STATE(i).onExit.end(); exitIter++) { @@ -1007,7 +1010,7 @@ ESTABLISH_ENTRYSET: } BIT_CLEAR(i, _configuration); - USCXML_MONITOR_CALLBACK1(monitors, afterExitingState, USCXML_GET_STATE(i).element); + USCXML_MONITOR_CALLBACK2(monitors, afterExitingState, USCXML_GET_STATE(i).name, USCXML_GET_STATE(i).element); } } @@ -1058,7 +1061,7 @@ ESTABLISH_ENTRYSET: continue; } - USCXML_MONITOR_CALLBACK1(monitors, beforeEnteringState, USCXML_GET_STATE(i).element); + USCXML_MONITOR_CALLBACK2(monitors, beforeEnteringState, USCXML_GET_STATE(i).name, USCXML_GET_STATE(i).element); BIT_SET_AT(i, _configuration); @@ -1079,7 +1082,7 @@ ESTABLISH_ENTRYSET: } } - USCXML_MONITOR_CALLBACK1(monitors, afterEnteringState, USCXML_GET_STATE(i).element); + USCXML_MONITOR_CALLBACK2(monitors, afterEnteringState, USCXML_GET_STATE(i).name, USCXML_GET_STATE(i).element); /* take history and initial transitions */ j = _transSet.find_first(); |