summaryrefslogtreecommitdiff
path: root/src/core/model/Node.hpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-09 13:34:27 +0100
committerAndreas Stöckel <andreas@somweyr.de>2015-01-09 13:34:27 +0100
commitcb16ee372fa5d189c47176436569291f1f35891e (patch)
tree838d2331377fcdff601ac56e9b8394e15cb3799b /src/core/model/Node.hpp
parent02642f74b12ce976fd32c73f5793e160ac2c2640 (diff)
Finished node resolution process
Diffstat (limited to 'src/core/model/Node.hpp')
-rw-r--r--src/core/model/Node.hpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/model/Node.hpp b/src/core/model/Node.hpp
index 97ec16f..c9c2808 100644
--- a/src/core/model/Node.hpp
+++ b/src/core/model/Node.hpp
@@ -106,8 +106,20 @@ private:
* of the path has been matched yet).
*
* @param state is used internally to manage the resolution process.
+ * @return true if the resolution is at the beginning, false otherwise.
*/
- static bool resolutionAtBeginning(ResolutionState &state);
+ static bool canFollowComposita(ResolutionState &state);
+
+ /**
+ * Returns true if following references is currently allowed in the
+ * resolution process. This is the case if the resolution is currently at
+ * the beginning (no part of the path has been matched yet) and this node
+ * is the current resolution root node.
+ *
+ * @param state is used internally to manage the resolution process.
+ * @return true if references can be followed, false otherwise.
+ */
+ static bool canFollowReferences(ResolutionState &state);
/**
* Method used internally for resolving nodes with a certain name and type
@@ -199,7 +211,8 @@ protected:
{
if (continueResolveIndex(index, state)) {
return true;
- } else if (resolutionAtBeginning(state)) {
+ }
+ if (canFollowComposita(state)) {
return continueResolveComposita(container, state);
}
return false;
@@ -228,7 +241,7 @@ protected:
template <class T>
bool continueResolveReferences(T &container, ResolutionState &state)
{
- if (resolutionAtBeginning(state)) {
+ if (canFollowReferences(state)) {
bool res = false;
for (auto elem : container) {
res = continueResolveReference(elem, state) | res;