summaryrefslogtreecommitdiff
path: root/src/core/resource
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-04-12 02:50:18 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:24:15 +0200
commitc7cb92f43f97ef5558eee0d7be6f18192134f3ec (patch)
tree6475300d3f1ad862a7d4e4514084770e33ce2775 /src/core/resource
parentc917381e5eb5700326d2389ffe0874565fc970ac (diff)
Replace NodeVector by ManagedVector where NodeVector functionality is not needed. Reduces calls to "Manager.registerEvent" to <10% of original value
Diffstat (limited to 'src/core/resource')
-rw-r--r--src/core/resource/ResourceManager.cpp12
-rw-r--r--src/core/resource/ResourceManager.hpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/resource/ResourceManager.cpp b/src/core/resource/ResourceManager.cpp
index cc53e0a..ea6e075 100644
--- a/src/core/resource/ResourceManager.cpp
+++ b/src/core/resource/ResourceManager.cpp
@@ -89,7 +89,7 @@ public:
bool isSuccess() { return success; }
};
-NodeVector<Node> ResourceManager::parse(
+ManagedVector<Node> ResourceManager::parse(
ParserContext &ctx, const std::string &path, const std::string &mimetype,
const std::string &rel, const RttiSet &supportedTypes, ParseMode mode)
{
@@ -105,11 +105,11 @@ NodeVector<Node> ResourceManager::parse(
Resource resource;
if (!req.deduce(registry, logger) ||
!req.locate(registry, logger, resource)) {
- return NodeVector<Node>{};
+ return ManagedVector<Node>{};
}
// initialize the output vector.
- NodeVector<Node> parsedNodes;
+ ManagedVector<Node> parsedNodes;
// Allocate a new SourceId handle for this Resource
bool newResource = false;
@@ -208,7 +208,7 @@ NodeVector<Node> ResourceManager::parse(
catch (LoggableException ex) {
// Log the exception and return nullptr
logger.log(ex);
- return NodeVector<Node>{};
+ return ManagedVector<Node>{};
}
}
@@ -235,7 +235,7 @@ Rooted<Node> ResourceManager::import(ParserContext &ctx,
const std::string &rel,
const RttiSet &supportedTypes)
{
- NodeVector<Node> res =
+ ManagedVector<Node> res =
parse(ctx, path, mimetype, rel, supportedTypes, ParseMode::IMPORT);
if (res.size() == 1U) {
return res[0];
@@ -243,7 +243,7 @@ Rooted<Node> ResourceManager::import(ParserContext &ctx,
return nullptr;
}
-NodeVector<Node> ResourceManager::include(ParserContext &ctx,
+ManagedVector<Node> ResourceManager::include(ParserContext &ctx,
const std::string &path,
const std::string &mimetype,
const std::string &rel,
diff --git a/src/core/resource/ResourceManager.hpp b/src/core/resource/ResourceManager.hpp
index 186ce42..67a650d 100644
--- a/src/core/resource/ResourceManager.hpp
+++ b/src/core/resource/ResourceManager.hpp
@@ -136,7 +136,7 @@ private:
* @param mode describes whether the file should be included or imported.
* @return the parsed nodes or an empty list if something went wrong.
*/
- NodeVector<Node> parse(ParserContext &ctx, const std::string &path,
+ ManagedVector<Node> parse(ParserContext &ctx, const std::string &path,
const std::string &mimetype, const std::string &rel,
const RttiSet &supportedTypes, ParseMode mode);
@@ -196,7 +196,7 @@ public:
* checked, not the actual result.
* @return the parsed nodes or an empty list if something went wrong.
*/
- NodeVector<Node> include(ParserContext &ctx, const std::string &path,
+ ManagedVector<Node> include(ParserContext &ctx, const std::string &path,
const std::string &mimetype,
const std::string &rel,
const RttiSet &supportedTypes);