summaryrefslogtreecommitdiffstats
path: root/src/uscxml/debug
diff options
context:
space:
mode:
authorStefan Radomski <sradomski@mintwerk.de>2016-02-23 11:28:18 (GMT)
committerStefan Radomski <sradomski@mintwerk.de>2016-02-23 11:28:18 (GMT)
commit7212d5a3dbbd2845d09df96b2c345132c8a24931 (patch)
tree194bf3525bc7b607013301b79dde6c9950ccbf2e /src/uscxml/debug
parent8e62f3801b98bf4b7f7f85b848b2fe6339c99162 (diff)
downloaduscxml-7212d5a3dbbd2845d09df96b2c345132c8a24931.zip
uscxml-7212d5a3dbbd2845d09df96b2c345132c8a24931.tar.gz
uscxml-7212d5a3dbbd2845d09df96b2c345132c8a24931.tar.bz2
Some refactoring for improved compile times
Diffstat (limited to 'src/uscxml/debug')
-rw-r--r--src/uscxml/debug/Breakpoint.cpp4
-rw-r--r--src/uscxml/debug/Breakpoint.h2
-rw-r--r--src/uscxml/debug/Complexity.cpp4
-rw-r--r--src/uscxml/debug/Debugger.cpp2
-rw-r--r--src/uscxml/debug/InterpreterIssue.cpp52
-rw-r--r--src/uscxml/debug/InterpreterIssue.h1
-rw-r--r--src/uscxml/debug/SCXMLDotWriter.cpp12
7 files changed, 39 insertions, 38 deletions
diff --git a/src/uscxml/debug/Breakpoint.cpp b/src/uscxml/debug/Breakpoint.cpp
index e66e0fb..d7eb2af 100644
--- a/src/uscxml/debug/Breakpoint.cpp
+++ b/src/uscxml/debug/Breakpoint.cpp
@@ -19,7 +19,7 @@
#include "uscxml/debug/Breakpoint.h"
#include "uscxml/Interpreter.h"
-#include "uscxml/DOMUtils.h"
+#include "uscxml/dom/DOMUtils.h"
namespace uscxml {
@@ -223,7 +223,7 @@ bool Breakpoint::matches(Interpreter interpreter, const Breakpoint& other) const
return false;
}
- if(eventName.length() > 0 && !InterpreterImpl::nameMatch(eventName, other.eventName)) {
+ if(eventName.length() > 0 && !nameMatch(eventName, other.eventName)) {
return false;
}
diff --git a/src/uscxml/debug/Breakpoint.h b/src/uscxml/debug/Breakpoint.h
index 71308aa..d7df03d 100644
--- a/src/uscxml/debug/Breakpoint.h
+++ b/src/uscxml/debug/Breakpoint.h
@@ -21,9 +21,9 @@
#define BREAKPOINT_H_VR7K7T1X
#include <string> // for string
+#include "uscxml/Common.h" // for USCXML_API
#include "uscxml/Interpreter.h"
#include "DOM/Element.hpp" // for Element
-#include "uscxml/Common.h" // for USCXML_API
#include "uscxml/messages/Data.h" // for Data
namespace uscxml {
diff --git a/src/uscxml/debug/Complexity.cpp b/src/uscxml/debug/Complexity.cpp
index 29d7706..a7f9f93 100644
--- a/src/uscxml/debug/Complexity.cpp
+++ b/src/uscxml/debug/Complexity.cpp
@@ -18,7 +18,7 @@
*/
#include "Complexity.h"
-#include "uscxml/DOMUtils.h"
+#include "uscxml/dom/DOMUtils.h"
#include <boost/algorithm/string.hpp>
@@ -97,7 +97,7 @@ std::map<size_t, size_t> Complexity::getTransitionHistogramm(const Arabica::DOM:
if (nameSpace.size() == 0 && elemIter->getPrefix().size() > 0)
nameSpace = elemIter->getPrefix() + ":";
}
- NodeSet<std::string> transitions = InterpreterImpl::filterChildElements(nameSpace + "transition", configNodeSet);
+ NodeSet<std::string> transitions = DOMUtils::filterChildElements(nameSpace + "transition", configNodeSet);
histogram[transitions.size()]++;
}
diff --git a/src/uscxml/debug/Debugger.cpp b/src/uscxml/debug/Debugger.cpp
index cb4d522..1a7d977 100644
--- a/src/uscxml/debug/Debugger.cpp
+++ b/src/uscxml/debug/Debugger.cpp
@@ -18,7 +18,7 @@
*/
#include "uscxml/debug/Debugger.h"
-#include "uscxml/DOMUtils.h"
+#include "uscxml/dom/DOMUtils.h"
#include "uscxml/debug/DebugSession.h"
namespace uscxml {
diff --git a/src/uscxml/debug/InterpreterIssue.cpp b/src/uscxml/debug/InterpreterIssue.cpp
index 6b97182..1fcfc00 100644
--- a/src/uscxml/debug/InterpreterIssue.cpp
+++ b/src/uscxml/debug/InterpreterIssue.cpp
@@ -20,7 +20,7 @@
#include <string>
#include "InterpreterIssue.h"
-#include "uscxml/DOMUtils.h"
+#include "uscxml/dom/DOMUtils.h"
#include "uscxml/debug/Complexity.h"
#include "uscxml/Interpreter.h"
#include "uscxml/Factory.h"
@@ -299,7 +299,7 @@ std::list<InterpreterIssue> InterpreterIssue::forInterpreter(InterpreterImpl* in
// check for valid transition with history states
if (LOCALNAME(state) == "history") {
- NodeSet<std::string> transitions = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", state, false);
+ NodeSet<std::string> transitions = DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "transition", state, false);
if (transitions.size() > 1) {
issues.push_back(InterpreterIssue("History pseudo-state with id '" + stateId + "' has multiple transitions", state, InterpreterIssue::USCXML_ISSUE_FATAL));
} else if (transitions.size() == 0) {
@@ -350,7 +350,7 @@ std::list<InterpreterIssue> InterpreterIssue::forInterpreter(InterpreterImpl* in
// check for valid target
if (HAS_ATTR(transition, "target")) {
- std::list<std::string> targetIds = InterpreterImpl::tokenizeIdRefs(ATTR(transition, "target"));
+ std::list<std::string> targetIds = tokenize(ATTR(transition, "target"));
if (targetIds.size() == 0) {
issues.push_back(InterpreterIssue("Transition has empty target state list", transition, InterpreterIssue::USCXML_ISSUE_FATAL));
}
@@ -367,7 +367,7 @@ std::list<InterpreterIssue> InterpreterIssue::forInterpreter(InterpreterImpl* in
// check for redundancy of transition
for (int i = 0; i < allStates.size(); i++) {
Element<std::string> state = Element<std::string>(allStates[i]);
- NodeSet<std::string> transitions = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", state, false);
+ NodeSet<std::string> transitions = DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "transition", state, false);
transitions.to_document_order();
@@ -386,11 +386,11 @@ std::list<InterpreterIssue> InterpreterIssue::forInterpreter(InterpreterImpl* in
} else if (HAS_ATTR(transition, "event")) {
// does the earlier transition match all our events?
- std::list<std::string> events = InterpreterImpl::tokenizeIdRefs(ATTR(transition, "event"));
+ std::list<std::string> events = tokenize(ATTR(transition, "event"));
bool allMatched = true;
for (std::list<std::string>::iterator eventIter = events.begin(); eventIter != events.end(); eventIter++) {
- if (!InterpreterImpl::nameMatch(ATTR(earlierTransition, "event"), *eventIter)) {
+ if (!nameMatch(ATTR(earlierTransition, "event"), *eventIter)) {
allMatched = false;
break;
}
@@ -438,12 +438,12 @@ NEXT_TRANSITION:
if (HAS_ATTR(state, "initial")) {
NodeSet<std::string> childs;
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "state", state, true));
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "parallel", state, true));
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "final", state, true));
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "history", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "state", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "parallel", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "final", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "history", state, true));
- std::list<std::string> intials = InterpreterImpl::tokenizeIdRefs(ATTR(state, "initial"));
+ std::list<std::string> intials = tokenize(ATTR(state, "initial"));
for (std::list<std::string>::iterator initIter = intials.begin(); initIter != intials.end(); initIter++) {
if (seenStates.find(*initIter) == seenStates.end()) {
issues.push_back(InterpreterIssue("Initial attribute has invalid target state with id '" + *initIter + "'", state, InterpreterIssue::USCXML_ISSUE_FATAL));
@@ -489,7 +489,7 @@ NEXT_TRANSITION:
setIter != targetIdSets.end();
setIter++) {
NodeSet<std::string> targets;
- std::list<std::string> targetIds = InterpreterImpl::tokenizeIdRefs(setIter->second);
+ std::list<std::string> targetIds = tokenize(setIter->second);
for (std::list<std::string>::iterator tgtIter = targetIds.begin(); tgtIter != targetIds.end(); tgtIter++) {
if (seenStates.find(*tgtIter) == seenStates.end())
goto NEXT_SET;
@@ -506,11 +506,11 @@ NEXT_SET:
// check for valid initial transition
{
NodeSet<std::string> initTrans;
-// initTrans.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", histories, true));
+// initTrans.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "transition", histories, true));
for (int i = 0; i < initials.size(); i++) {
Element<std::string> initial = Element<std::string>(initials[i]);
- NodeSet<std::string> initTransitions = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "transition", initial, true);
+ NodeSet<std::string> initTransitions = DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "transition", initial, true);
if (initTransitions.size() != 1) {
issues.push_back(InterpreterIssue("Initial element must define exactly one transition", initial, InterpreterIssue::USCXML_ISSUE_FATAL));
}
@@ -539,12 +539,12 @@ NEXT_SET:
continue; // syntax will catch this one
NodeSet<std::string> childs;
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "state", state, true));
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "parallel", state, true));
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "final", state, true));
- childs.push_back(InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "history", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "state", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "parallel", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "final", state, true));
+ childs.push_back(DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "history", state, true));
- std::list<std::string> intials = InterpreterImpl::tokenizeIdRefs(ATTR(transition, "target"));
+ std::list<std::string> intials = tokenize(ATTR(transition, "target"));
for (std::list<std::string>::iterator initIter = intials.begin(); initIter != intials.end(); initIter++) {
// the 'target' of a <transition> inside an <initial> or <history> element: all the states must be descendants of the containing <state> or <parallel> element
if (!InterpreterImpl::isMember(seenStates[*initIter], childs)) {
@@ -602,7 +602,7 @@ NEXT_SET:
for (int i = 0; i < allExecContentContainers.size(); i++) {
Element<std::string> block = Element<std::string>(allExecContentContainers[i]);
- NodeSet<std::string> execContents = InterpreterImpl::filterChildType(Node_base::ELEMENT_NODE, block);
+ NodeSet<std::string> execContents = DOMUtils::filterChildType(Node_base::ELEMENT_NODE, block);
for (int j = 0; j < execContents.size(); j++) {
Element<std::string> execContent = Element<std::string>(execContents[j]);
// SCXML specific executable content, always available
@@ -723,8 +723,8 @@ NEXT_SET:
issues.push_back(InterpreterIssue("Send element cannot have delay with target _internal", send, InterpreterIssue::USCXML_ISSUE_WARNING));
}
- NodeSet<std::string> contentChilds = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "content", send, false);
- NodeSet<std::string> paramChilds = InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "param", send, false);
+ NodeSet<std::string> contentChilds = DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "content", send, false);
+ NodeSet<std::string> paramChilds = DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "param", send, false);
if (HAS_ATTR(send, "namelist") && contentChilds.size() > 0) {
issues.push_back(InterpreterIssue("Send element cannot have namelist attribute and content child", send, InterpreterIssue::USCXML_ISSUE_WARNING));
@@ -753,18 +753,18 @@ NEXT_SET:
if (HAS_ATTR(invoke, "id") && HAS_ATTR(invoke, "idlocation")) {
issues.push_back(InterpreterIssue("Invoke element cannot have both id and idlocation attribute", invoke, InterpreterIssue::USCXML_ISSUE_WARNING));
}
- if (HAS_ATTR(invoke, "namelist") && InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "param", invoke, false).size() > 0) {
+ if (HAS_ATTR(invoke, "namelist") && DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "param", invoke, false).size() > 0) {
issues.push_back(InterpreterIssue("Invoke element cannot have namelist attribute and param child", invoke, InterpreterIssue::USCXML_ISSUE_WARNING));
}
- if (HAS_ATTR(invoke, "src") && InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "content", invoke, false).size() > 0) {
+ if (HAS_ATTR(invoke, "src") && DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "content", invoke, false).size() > 0) {
issues.push_back(InterpreterIssue("Invoke element cannot have src attribute and content child", invoke, InterpreterIssue::USCXML_ISSUE_WARNING));
}
}
for (int i = 0; i < doneDatas.size(); i++) {
Element<std::string> donedata = Element<std::string>(doneDatas[i]);
- if (InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "content", donedata, false).size() > 0 &&
- InterpreterImpl::filterChildElements(_nsInfo.xmlNSPrefix + "param", donedata, false).size() > 0) {
+ if (DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "content", donedata, false).size() > 0 &&
+ DOMUtils::filterChildElements(_nsInfo.xmlNSPrefix + "param", donedata, false).size() > 0) {
issues.push_back(InterpreterIssue("Donedata element cannot have param child and content child", donedata, InterpreterIssue::USCXML_ISSUE_WARNING));
}
diff --git a/src/uscxml/debug/InterpreterIssue.h b/src/uscxml/debug/InterpreterIssue.h
index 5959d07..61b3b6a 100644
--- a/src/uscxml/debug/InterpreterIssue.h
+++ b/src/uscxml/debug/InterpreterIssue.h
@@ -22,6 +22,7 @@
#include "uscxml/Common.h"
#include <list>
+#include <iostream>
#include <DOM/Node.hpp>
namespace uscxml {
diff --git a/src/uscxml/debug/SCXMLDotWriter.cpp b/src/uscxml/debug/SCXMLDotWriter.cpp
index 82faaa4..a6ec0b6 100644
--- a/src/uscxml/debug/SCXMLDotWriter.cpp
+++ b/src/uscxml/debug/SCXMLDotWriter.cpp
@@ -21,7 +21,7 @@
#include "uscxml/UUID.h"
#include "SCXMLDotWriter.h"
#include "../transform/FlatStateIdentifier.h"
-#include "uscxml/DOMUtils.h"
+#include "uscxml/dom/DOMUtils.h"
#include <boost/algorithm/string.hpp> // replace_all
#include <iomanip>
@@ -199,7 +199,7 @@ void SCXMLDotWriter::assembleGraph(const Element<std::string>& state, int32_t ch
}
- NodeSet<std::string> childElems = InterpreterImpl::filterChildType(Node_base::ELEMENT_NODE, state);
+ NodeSet<std::string> childElems = DOMUtils::filterChildType(Node_base::ELEMENT_NODE, state);
for (int i = 0; i < childElems.size(); i++) {
Element<std::string> childElem(childElems[i]);
@@ -225,7 +225,7 @@ void SCXMLDotWriter::assembleGraph(const Element<std::string>& state, int32_t ch
std::list<std::string> eventNames;
if (HAS_ATTR(childElem, "event"))
- eventNames = InterpreterImpl::tokenizeIdRefs(ATTR(childElem, "event"));
+ eventNames = tokenize(ATTR(childElem, "event"));
if (eventNames.size() == 0)
_graph[nodeId].events.insert(std::make_pair("", childElem));
for (std::list<std::string>::iterator evIter = eventNames.begin(); evIter != eventNames.end(); evIter++) {
@@ -399,7 +399,7 @@ void SCXMLDotWriter::writeStateElement(std::ostream& os, const Element<std::stri
}
// write history states
- NodeSet<std::string> histories = InterpreterImpl::filterChildElements(_xmlNSPrefix + "history", stateElem);
+ NodeSet<std::string> histories = DOMUtils::filterChildElements(_xmlNSPrefix + "history", stateElem);
for (int i = 0; i < histories.size(); i++) {
os << " <tr><td port=\"" << portEscape(ATTR_CAST(histories[i], "id")) << "\" balign=\"left\" colspan=\"" << (nrOutPorts == 0 ? 1 : 2) << "\"><b>history: </b>" << ATTR_CAST(histories[i], "id") << "</td></tr>" << std::endl;
@@ -421,7 +421,7 @@ void SCXMLDotWriter::writeStateElement(std::ostream& os, const Element<std::stri
}
// recurse into children and search others to draw
- NodeSet<std::string> childElems = InterpreterImpl::filterChildType(Node_base::ELEMENT_NODE, stateElem);
+ NodeSet<std::string> childElems = DOMUtils::filterChildType(Node_base::ELEMENT_NODE, stateElem);
for (int i = 0; i < childElems.size(); i++) {
Element<std::string> childElem(childElems[i]);
if (InterpreterImpl::isState(Element<std::string>(childElem))) {
@@ -538,7 +538,7 @@ void SCXMLDotWriter::writePerTargetPorts(std::ostream& os, const DotState& dotSt
for (iter_t::const_iterator transIter = targetKeyRange.first; transIter != targetKeyRange.second; ++transIter) {
const Element<std::string>& transElem = transIter->second;
- std::list<std::string> events = InterpreterImpl::tokenizeIdRefs(ATTR(transElem, "event"));
+ std::list<std::string> events = tokenize(ATTR(transElem, "event"));
eventNames.insert(events.begin(), events.end());
if (events.size() == 0) {