summaryrefslogtreecommitdiff
path: root/src/core/model/Node.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-29 22:52:29 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-29 22:52:29 +0100
commit90b2e9507e9d720452792b863b422221fe96d948 (patch)
tree407a271de4730d087de4132eab3921c44c65e400 /src/core/model/Node.cpp
parentde0891c69166f6988e0b13137f9bf2b7b67449f2 (diff)
Unified signature of resolve functions, passing the "owner" to the callback functions in ParserScope::resolve
Diffstat (limited to 'src/core/model/Node.cpp')
-rw-r--r--src/core/model/Node.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/core/model/Node.cpp b/src/core/model/Node.cpp
index 6c00e89..7cbbbe1 100644
--- a/src/core/model/Node.cpp
+++ b/src/core/model/Node.cpp
@@ -60,14 +60,14 @@ using VisitorSet =
class SharedResolutionState {
public:
/**
- * Actual path (name pattern) that was requested for resolution.
+ * Type of the node that was requested for resolution.
*/
- const std::vector<std::string> &path;
+ const Rtti &type;
/**
- * Type of the node that was requested for resolution.
+ * Actual path (name pattern) that was requested for resolution.
*/
- const Rtti &type;
+ const std::vector<std::string> &path;
/**
* Tracks all nodes that have already been visited.
@@ -82,13 +82,13 @@ public:
/**
* Constructor of the SharedResolutionState class.
*
+ * @param type is the type of the node that should be resolved.
* @param path is a const reference to the actual path that should be
* resolved.
- * @param type is the type of the node that should be resolved.
*/
- SharedResolutionState(const std::vector<std::string> &path,
- const Rtti &type)
- : path(path), type(type)
+ SharedResolutionState(const Rtti &type,
+ const std::vector<std::string> &path)
+ : type(type), path(path)
{
}
};
@@ -329,10 +329,10 @@ bool Node::continueResolveReference(Handle<Node> h, ResolutionState &state)
}
std::vector<ResolutionResult> Node::resolve(
- const std::vector<std::string> &path, const Rtti &type)
+ const Rtti &type, const std::vector<std::string> &path)
{
// Create the state variables
- SharedResolutionState sharedState(path, type);
+ SharedResolutionState sharedState(type, path);
ResolutionState state(sharedState, this);
// Kickstart the resolution process by treating this very node as compositum
@@ -344,11 +344,11 @@ std::vector<ResolutionResult> Node::resolve(
return sharedState.result;
}
-std::vector<ResolutionResult> Node::resolve(const std::string &name,
- const Rtti &type)
+std::vector<ResolutionResult> Node::resolve(const Rtti &type,
+ const std::string &name)
{
// Place the name in a vector and call the corresponding resolve function
- return resolve(std::vector<std::string>{name}, type);
+ return resolve(type, std::vector<std::string>{name});
}
bool Node::checkDuplicate(Handle<Node> elem,