From 90b2e9507e9d720452792b863b422221fe96d948 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Thu, 29 Jan 2015 22:52:29 +0100 Subject: Unified signature of resolve functions, passing the "owner" to the callback functions in ParserScope::resolve --- src/core/model/Node.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/core/model/Node.cpp') 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 &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 &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 &path, - const Rtti &type) - : path(path), type(type) + SharedResolutionState(const Rtti &type, + const std::vector &path) + : type(type), path(path) { } }; @@ -329,10 +329,10 @@ bool Node::continueResolveReference(Handle h, ResolutionState &state) } std::vector Node::resolve( - const std::vector &path, const Rtti &type) + const Rtti &type, const std::vector &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 Node::resolve( return sharedState.result; } -std::vector Node::resolve(const std::string &name, - const Rtti &type) +std::vector 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{name}, type); + return resolve(type, std::vector{name}); } bool Node::checkDuplicate(Handle elem, -- cgit v1.2.3