From 00dcccce979243fa9721e5be27eedc136ad439e5 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Fri, 30 Jan 2015 14:12:32 +0100 Subject: some formatting stuff and cycle detection in include as well as repeated import detection. --- src/core/resource/ResourceManager.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/core/resource/ResourceManager.hpp') diff --git a/src/core/resource/ResourceManager.hpp b/src/core/resource/ResourceManager.hpp index 1279bee..186ce42 100644 --- a/src/core/resource/ResourceManager.hpp +++ b/src/core/resource/ResourceManager.hpp @@ -81,6 +81,11 @@ private: */ std::unordered_map nodes; + /** + * The set of SourceIds for which resources are currently being parsed. + */ + std::unordered_set currentlyParsing; + /** * Map containing SourceContextReader instances which are -- as their name * suggests -- used to produce SourceContext structures describing the @@ -132,8 +137,8 @@ private: * @return the parsed nodes or an empty list if something went wrong. */ NodeVector parse(ParserContext &ctx, const std::string &path, - const std::string &mimetype, const std::string &rel, - const RttiSet &supportedTypes, ParseMode mode); + const std::string &mimetype, const std::string &rel, + const RttiSet &supportedTypes, ParseMode mode); public: /** @@ -161,8 +166,8 @@ public: * @return the parsed node or nullptr if something went wrong. */ Rooted import(ParserContext &ctx, const std::string &path, - const std::string &mimetype, const std::string &rel, - const RttiSet &supportedTypes); + const std::string &mimetype, const std::string &rel, + const RttiSet &supportedTypes); /** * Resolves the reference to the file specified by the given path and parses @@ -192,8 +197,9 @@ public: * @return the parsed nodes or an empty list if something went wrong. */ NodeVector include(ParserContext &ctx, const std::string &path, - const std::string &mimetype, const std::string &rel, - const RttiSet &supportedTypes); + const std::string &mimetype, + const std::string &rel, + const RttiSet &supportedTypes); /** * Creates and returns a SourceContext structure containing information -- cgit v1.2.3