From 1891587b43da42d99ffab26517972523a6f80123 Mon Sep 17 00:00:00 2001 From: Philip Rauwolf Date: Tue, 25 Jun 2013 10:31:33 +0200 Subject: Overloading of visible Runtime::createFactory methods --- src/CommonAPI/Runtime.cpp | 5 +++++ src/CommonAPI/Runtime.h | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/CommonAPI/Runtime.cpp b/src/CommonAPI/Runtime.cpp index f930db9..f5a8096 100644 --- a/src/CommonAPI/Runtime.cpp +++ b/src/CommonAPI/Runtime.cpp @@ -57,6 +57,11 @@ std::shared_ptr Runtime::getNewMainLoopContext() const { return std::make_shared(); } +std::shared_ptr Runtime::createFactory(const std::string factoryName, + const bool nullOnInvalidName) { + return createFactory(std::shared_ptr(NULL), factoryName, nullOnInvalidName); +} + std::shared_ptr Runtime::createFactory(std::shared_ptr mainLoopContext, const std::string factoryName, const bool nullOnInvalidName) { diff --git a/src/CommonAPI/Runtime.h b/src/CommonAPI/Runtime.h index 6a8eeec..c0040a8 100644 --- a/src/CommonAPI/Runtime.h +++ b/src/CommonAPI/Runtime.h @@ -104,6 +104,24 @@ class Runtime { const std::string factoryName = "", const bool nullOnInvalidName = false); + /** + * \brief Create a factory for the loaded runtime. + * + * Create a factory for the loaded runtime + * + * @param factoryName: If additional configuration parameters for the specific middleware factory shall be provided, + * the appropriate set of parameters may be identified by this name. See accompanying documentation for + * usage of configuration files. + * + * @param nullOnInvalidName: If a factoryName is provided, this parameter determines whether the standard configuration + * for factories shall be used if the specific parameter set cannot be found, or if instead no factory + * shall be returned in this case. + * + * @return Factory object for this runtime + */ + virtual std::shared_ptr createFactory(const std::string factoryNamey, + const bool nullOnInvalidName = false); + /** * \brief Returns the ServicePublisher object for this runtime. * @@ -117,9 +135,9 @@ class Runtime { virtual std::shared_ptr getServicePublisher() = 0; protected: - virtual std::shared_ptr doCreateFactory(std::shared_ptr, + virtual std::shared_ptr doCreateFactory(std::shared_ptr mainLoopContext, const std::string factoryName, - const bool nullOnInvalidName) = 0; + const bool nullOnInvalidName = false) = 0; }; -- cgit v1.2.1