diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-04 21:39:39 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-04 21:39:39 (GMT) |
commit | 83ef70ebc7527240f56e2e601777a613bce6e47e (patch) | |
tree | c520fec5b446672b69353a0b37460631840b4219 /src/uscxml/transform/ChartToFSM.cpp | |
parent | 932916f952f302a46e41841ccf95ec1b7851b302 (diff) | |
download | uscxml-83ef70ebc7527240f56e2e601777a613bce6e47e.zip uscxml-83ef70ebc7527240f56e2e601777a613bce6e47e.tar.gz uscxml-83ef70ebc7527240f56e2e601777a613bce6e47e.tar.bz2 |
Beautified flattened state-machine ids
Diffstat (limited to 'src/uscxml/transform/ChartToFSM.cpp')
-rw-r--r-- | src/uscxml/transform/ChartToFSM.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/uscxml/transform/ChartToFSM.cpp b/src/uscxml/transform/ChartToFSM.cpp index 83b8195..9665b56 100644 --- a/src/uscxml/transform/ChartToFSM.cpp +++ b/src/uscxml/transform/ChartToFSM.cpp @@ -18,6 +18,7 @@ */ #include "uscxml/transform/ChartToFSM.h" +#include "uscxml/transform/FlatStateIdentifier.h" #include "uscxml/Factory.h" #include <DOM/io/Stream.hpp> @@ -1009,33 +1010,8 @@ GlobalState::GlobalState(const Arabica::XPath::NodeSet<std::string>& activeState historyIter->second.to_document_order(); } - // create a unique identifier for a global configuration - std::ostringstream idSS; - idSS << "active-"; - for (int i = 0; i < activeStates.size(); i++) { - if (!InterpreterImpl::isFinal(Element<std::string>(activeStates[i]))) - isFinal = false; - idSS << ATTR_CAST(activeStates[i], "id") << "-"; - } - idSS << ";"; - idSS << "entered-"; - for (int i = 0; i < alreadyEnteredStates.size(); i++) { - idSS << ATTR_CAST(alreadyEnteredStates[i], "id") << "-"; - } - idSS << ";"; - - for(std::map<std::string, Arabica::XPath::NodeSet<std::string> >::const_iterator histIter = historyStates.begin(); - histIter != historyStates.end(); - histIter++) { - const Arabica::XPath::NodeSet<std::string>& histStates = histIter->second; - idSS << "history--"; - idSS << histIter->first << "-"; - for (int i = 0; i < histStates.size(); i++) { - idSS << ATTR_CAST(histStates[i], "id") << "-"; - } - } - - stateId = idSS.str(); + FlatStateIdentifier flatStateId(activeStates, alreadyEnteredStates, historyStates); + stateId = flatStateId.getStateId(); } GlobalTransition::GlobalTransition(const Arabica::XPath::NodeSet<std::string>& transitionSet, DataModel dataModel) { |