From 67c3618e593f88eb8177404475586735902d693f Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 25 Jan 2015 18:57:19 +0100 Subject: Restructures parser classes a little, removed Registry from ParserContext, gave a ResourceManager instance to the Project, using ResourceRequest when including or linking files, thought through how "including" and "linking" are handled --- src/core/parser/ParserStack.hpp | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'src/core/parser/ParserStack.hpp') diff --git a/src/core/parser/ParserStack.hpp b/src/core/parser/ParserStack.hpp index 6296dff..031ce68 100644 --- a/src/core/parser/ParserStack.hpp +++ b/src/core/parser/ParserStack.hpp @@ -139,15 +139,13 @@ public: const std::string &name() { return handlerData.name; } - ParserScope &scope() { return handlerData.ctx.scope; } + ParserScope &scope() { return handlerData.ctx.getScope(); } - Registry ®istry() { return handlerData.ctx.registry; } + Manager &manager() { return handlerData.ctx.getManager(); } - Manager &manager() { return handlerData.ctx.manager; } + Logger &logger() { return handlerData.ctx.getLogger(); } - Logger &logger() { return handlerData.ctx.logger; } - - Rooted project() { return handlerData.ctx.project; } + Rooted project() { return handlerData.ctx.getProject(); } State state() { return handlerData.state; } @@ -321,11 +319,6 @@ private: */ std::stack stack; - /** - * Reference at some user defined data. - */ - void *userData; - /** * Used internally to get all expected command names for the given state * (does not work if the current Handler instance allows arbitrary @@ -345,9 +338,8 @@ public: * corresponding HandlerDescriptor instances. */ ParserStack(ParserContext &ctx, - const std::multimap &handlers, - void *userData = nullptr) - : ctx(ctx), handlers(handlers), userData(userData){}; + const std::multimap &handlers) + : ctx(ctx), handlers(handlers){}; /** * Returns the state the ParserStack instance currently is in. @@ -425,13 +417,6 @@ public: * @return a reference to the parser context. */ ParserContext &getContext() { return ctx; } - - /** - * Returns the user defined data. - * - * @return the userData pointer that was given in the constructor. - */ - void *getUserData() { return userData; } }; } -- cgit v1.2.3