summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Rauwolf <rauwolf@itestra.de>2013-06-17 13:12:51 +0200
committerJohannes Schanda <schanda@itestra.de>2013-06-17 14:00:52 +0200
commit74b90aeece8cc8dd7f6e3fb275851e80b8754d7e (patch)
treed32b325e095339c2ce16bdc945b1c528cb76b616 /src
parent2440cd3058d3706ba5ff10ca4e3a6e111bc1f1d6 (diff)
downloadgenivi-common-api-runtime-74b90aeece8cc8dd7f6e3fb275851e80b8754d7e.tar.gz
Extensions for named factories
Extended factory creation to support named factories Change-Id: Iab66080a48676512dee44a7dd4001205310103a9
Diffstat (limited to 'src')
-rw-r--r--src/CommonAPI/Factory.h14
-rw-r--r--src/CommonAPI/Runtime.h4
-rw-r--r--src/CommonAPI/types.h31
3 files changed, 31 insertions, 18 deletions
diff --git a/src/CommonAPI/Factory.h b/src/CommonAPI/Factory.h
index e5d5993..ede8536 100644
--- a/src/CommonAPI/Factory.h
+++ b/src/CommonAPI/Factory.h
@@ -22,6 +22,7 @@
#include "MiddlewareInfo.h"
#include "Proxy.h"
#include "Stub.h"
+#include "types.h"
namespace CommonAPI {
@@ -61,6 +62,19 @@ class Factory {
middlewareInfo_(middlewareInfo) {
}
+ /**
+ * \brief Creates factory. Don't call manually.
+ *
+ * Creates factory. Don't call manually.
+ */
+ Factory(const std::shared_ptr<Runtime> runtime,
+ const MiddlewareInfo* middlewareInfo,
+ const std::string factoryName,
+ const bool nullOnInvalidName) :
+ runtime_(runtime),
+ middlewareInfo_(middlewareInfo) {
+ }
+
virtual ~Factory() {}
/**
diff --git a/src/CommonAPI/Runtime.h b/src/CommonAPI/Runtime.h
index 7b666b6..5cf7afa 100644
--- a/src/CommonAPI/Runtime.h
+++ b/src/CommonAPI/Runtime.h
@@ -90,7 +90,9 @@ class Runtime {
*
* @return Factory object for this runtime
*/
- virtual std::shared_ptr<Factory> createFactory(std::shared_ptr<MainLoopContext> = std::shared_ptr<MainLoopContext>(NULL)) = 0;
+ virtual std::shared_ptr<Factory> createFactory(std::shared_ptr<MainLoopContext> = std::shared_ptr<MainLoopContext>(NULL),
+ const std::string factoryName = "",
+ const bool nullOnInvalidName = false) = 0;
/**
* \brief Returns the ServicePublisher object for this runtime.
diff --git a/src/CommonAPI/types.h b/src/CommonAPI/types.h
index c7fdeb8..ae2836e 100644
--- a/src/CommonAPI/types.h
+++ b/src/CommonAPI/types.h
@@ -14,7 +14,6 @@
#include <cstdint>
-
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
# define COMMONAPI_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
@@ -27,33 +26,31 @@
namespace CommonAPI {
enum class AvailabilityStatus {
- UNKNOWN,
- AVAILABLE,
- NOT_AVAILABLE
+ UNKNOWN,
+ AVAILABLE,
+ NOT_AVAILABLE
};
-
enum class CallStatus {
- SUCCESS,
- OUT_OF_MEMORY,
- NOT_AVAILABLE,
- CONNECTION_FAILED,
- REMOTE_ERROR
+ SUCCESS,
+ OUT_OF_MEMORY,
+ NOT_AVAILABLE,
+ CONNECTION_FAILED,
+ REMOTE_ERROR
};
struct Version {
- Version() = default;
+ Version() = default;
- Version(const uint32_t& majorValue, const uint32_t& minorValue):
- Major(majorValue),
- Minor(minorValue) { }
+ Version(const uint32_t& majorValue, const uint32_t& minorValue):
+ Major(majorValue),
+ Minor(minorValue) {}
- uint32_t Major;
- uint32_t Minor;
+ uint32_t Major;
+ uint32_t Minor;
};
-
} // namespace CommonAPI
#endif // COMMONAPI_TYPES_H_