summaryrefslogtreecommitdiff
path: root/src/core/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model')
-rw-r--r--src/core/model/Node.cpp26
-rw-r--r--src/core/model/Node.hpp17
2 files changed, 22 insertions, 21 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,
diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp
index 036bcae..61bf418 100644
--- a/src/core/model/Node.hpp
+++ b/src/core/model/Node.hpp
@@ -223,7 +223,7 @@ private:
* @param thisRef is the Node of which the reference should be returned.
* @return the value of the reference.
*/
- using NodeReferenceCallback = const Node* (const Node* thisRef);
+ using NodeReferenceCallback = const Node *(const Node *thisRef);
/**
* Checks whether the a certain property is acyclic.
@@ -400,7 +400,8 @@ protected:
* @return true if the parent reference is acyclic, false otherwise.
*/
bool validateIsAcyclic(const std::string &name,
- NodeReferenceCallback callback, Logger &logger) const;
+ NodeReferenceCallback callback,
+ Logger &logger) const;
/**
* Makes sure the "parent" reference is not cyclic.
@@ -538,26 +539,26 @@ public:
* Function which resolves a name path to a list of possible nodes starting
* from this node.
*
+ * @param type specifies the type of the node that should be located.
* @param path is a list specifying a path of node names meant to specify a
* certain named node.
- * @param type specifies the type of the node that should be located.
* @return a vector containing ResolutionResult structures which describe
* the resolved elements.
*/
- std::vector<ResolutionResult> resolve(const std::vector<std::string> &path,
- const Rtti &type);
+ std::vector<ResolutionResult> resolve(const Rtti &type,
+ const std::vector<std::string> &path);
/**
* Function which resolves a single name to a list of possible nodes
* starting from this node.
*
- * @param name is the name which should be resolved.
* @param type specifies the type of the node that should be located.
+ * @param name is the name which should be resolved.
* @return a vector containing ResolutionResult structures which describe
* the resolved elements.
*/
- std::vector<ResolutionResult> resolve(const std::string &name,
- const Rtti &type);
+ std::vector<ResolutionResult> resolve(const Rtti &type,
+ const std::string &name);
/**
* Checks whether this node is valid and returns true if it is and false