diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-03 21:51:41 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-03 21:51:41 +0100 |
commit | e5a0db3de5bcee624e680ef62d1c02f22e1d3591 (patch) | |
tree | 4b6f7949983d37964f12d6db13256cda7871bdcf /src/core/parser/ParserScope.hpp | |
parent | 5fb3d3f7f785144425513a734e2a9fc0dfd8a045 (diff) |
Throwing an Exception in RttiScope.select if no node is found. This is much cleaner.
Diffstat (limited to 'src/core/parser/ParserScope.hpp')
-rw-r--r-- | src/core/parser/ParserScope.hpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/parser/ParserScope.hpp b/src/core/parser/ParserScope.hpp index 057d918..dc1b1bf 100644 --- a/src/core/parser/ParserScope.hpp +++ b/src/core/parser/ParserScope.hpp @@ -145,22 +145,25 @@ public: /** * Ascends in the stack starting with the leaf node, returns the first node - * that matches the type given in the RttiSet or nullptr if none matches. + * that matches the type given in the RttiSet. Throws an exception if no + * node matches. * * @param types is a set of Rtti types for which should be searched in the * stack. * @param maxDepth is the maximum number of stack entries the selection * function may ascend. A negative value indicates no limitation. + * @return the matching node. */ Rooted<Node> select(RttiSet types, int maxDepth = -1); /** * Ascends in the stack starting with the leaf node, returns the first node - * that matches the given type or nullptr if none matches. + * that matches the given type. Throws an exception if no node matches. * * @tparam T is the type that should be searched in the stack. * @param maxDepth is the maximum number of stack entries the selection * function may ascend. A negative value indicates no limitation. + * @return the matching node. */ template <class T> Rooted<T> select(int maxDepth = -1) |