From c7cb92f43f97ef5558eee0d7be6f18192134f3ec Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 12 Apr 2015 02:50:18 +0200 Subject: Replace NodeVector by ManagedVector where NodeVector functionality is not needed. Reduces calls to "Manager.registerEvent" to <10% of original value --- src/core/parser/ParserScope.hpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/core/parser/ParserScope.hpp') diff --git a/src/core/parser/ParserScope.hpp b/src/core/parser/ParserScope.hpp index 0a1e90b..85b5d8b 100644 --- a/src/core/parser/ParserScope.hpp +++ b/src/core/parser/ParserScope.hpp @@ -74,7 +74,7 @@ protected: * List containing all nodes currently on the scope, with the newest nodes * being pushed to the back of the list. */ - NodeVector nodes; + ManagedVector nodes; public: /** @@ -84,13 +84,12 @@ public: /** * Creates a new instance of the ParserScopeBase class, copying the the - *given - * nodes as initial start value of the node stack. This could for example - * be initialized with the path of a node. + * given nodes as initial start value of the node stack. This could for + * example be initialized with the path of a node. * * @param nodes is a node vector containing the current node stack. */ - ParserScopeBase(const NodeVector &nodes); + ParserScopeBase(const ManagedVector &nodes); /** * Tries to resolve a node for the given type and path for all nodes that @@ -118,7 +117,7 @@ public: * * @return a const reference at the internal node stack. */ - const NodeVector &getStack() const; + const ManagedVector &getStack() const; /** * Returns a list containing the Rtti type of each Node that is currently @@ -247,7 +246,7 @@ public: * the desired element has indeed been found. * @param owner is the node for which the resolution takes place. */ - DeferredResolution(const NodeVector &nodes, + DeferredResolution(const ManagedVector &nodes, const std::vector &path, const Rtti *type, ResolutionResultCallback resultCallback, Handle owner); @@ -376,12 +375,12 @@ private: * List of a all nodes that have been pushed onto the scope at the top level * depth. */ - NodeVector topLevelNodes; + ManagedVector topLevelNodes; /** * Private constructor used to create a ParserScope fork. */ - ParserScope(const NodeVector &nodes, + ParserScope(const ManagedVector &nodes, const std::vector &flags); public: @@ -450,7 +449,7 @@ public: * * @return a node vector containing the top-level nodes. */ - NodeVector getTopLevelNodes() const; + ManagedVector getTopLevelNodes() const; /** * Sets a parser flag for the current stack depth. -- cgit v1.2.3