Overloading of visible Runtime::createFactory methods
authorPhilip Rauwolf <rauwolf@itestra.de>
Tue, 25 Jun 2013 08:31:33 +0000 (10:31 +0200)
committerPhilip Rauwolf <rauwolf@itestra.de>
Tue, 25 Jun 2013 08:31:33 +0000 (10:31 +0200)
src/CommonAPI/Runtime.cpp
src/CommonAPI/Runtime.h

index f930db9..f5a8096 100644 (file)
@@ -57,6 +57,11 @@ std::shared_ptr<MainLoopContext> Runtime::getNewMainLoopContext() const {
     return std::make_shared<MainLoopContext>();
 }
 
+std::shared_ptr<Factory> Runtime::createFactory(const std::string factoryName,
+                                                const bool nullOnInvalidName) {
+    return createFactory(std::shared_ptr<MainLoopContext>(NULL), factoryName, nullOnInvalidName);
+}
+
 std::shared_ptr<Factory> Runtime::createFactory(std::shared_ptr<MainLoopContext> mainLoopContext,
                                                 const std::string factoryName,
                                                 const bool nullOnInvalidName) {
index 6a8eeec..c0040a8 100644 (file)
@@ -105,6 +105,24 @@ class Runtime {
                                                    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<Factory> createFactory(const std::string factoryNamey,
+                                                   const bool nullOnInvalidName = false);
+
+    /**
      * \brief Returns the ServicePublisher object for this runtime.
      *
      * Returns the ServicePublisher object for this runtime. Use the interface
@@ -117,9 +135,9 @@ class Runtime {
     virtual std::shared_ptr<ServicePublisher> getServicePublisher() = 0;
 
  protected:
-    virtual std::shared_ptr<Factory> doCreateFactory(std::shared_ptr<MainLoopContext>,
+    virtual std::shared_ptr<Factory> doCreateFactory(std::shared_ptr<MainLoopContext> mainLoopContext,
                                                      const std::string factoryName,
-                                                     const bool nullOnInvalidName) = 0;
+                                                     const bool nullOnInvalidName = false) = 0;
 };