diff options
author | Stefan Laner <laner@itestra.de> | 2014-02-24 09:41:53 +0100 |
---|---|---|
committer | Stefan Laner <laner@itestra.de> | 2014-02-26 10:52:17 +0100 |
commit | b94ed2030fd13d100a757d531983b2fd2498b62e (patch) | |
tree | cc2c675f7999130edbd4ea76ebd6458d0d730c9b /src/CommonAPI/Factory.h | |
parent | fa209eed0e5c81c277601aa24069fa23f61b675d (diff) | |
download | genivi-common-api-runtime-b94ed2030fd13d100a757d531983b2fd2498b62e.tar.gz |
Windows compatible version
Change-Id: I775e584175ec3dcde258e7bed261c61e763d20ce
Diffstat (limited to 'src/CommonAPI/Factory.h')
-rw-r--r-- | src/CommonAPI/Factory.h | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/src/CommonAPI/Factory.h b/src/CommonAPI/Factory.h index ccf9004..4a7c729 100644 --- a/src/CommonAPI/Factory.h +++ b/src/CommonAPI/Factory.h @@ -24,6 +24,7 @@ #include "Stub.h" #include "types.h" #include "utils.h" +#include "AttributeExtension.h" namespace CommonAPI { @@ -91,10 +92,33 @@ class Factory { * @return a shared pointer to the constructed proxy */ template<template<typename ...> class _ProxyClass, typename ... _AttributeExtensions> - std::shared_ptr<_ProxyClass<_AttributeExtensions...> > + std::shared_ptr< + _ProxyClass< +#ifdef WIN32 + CommonAPI::WINDummyAttributeExtension<WINDummyAttribute>, +#endif + _AttributeExtensions...> + > buildProxy(const std::string& participantId, const std::string& serviceName, - const std::string& domain); + const std::string& domain) { + std::shared_ptr<Proxy> abstractMiddlewareProxy = createProxy(_ProxyClass<_AttributeExtensions...>::getInterfaceId(), participantId, serviceName, domain); + + if(abstractMiddlewareProxy) { + auto returnProxy = std::make_shared< + _ProxyClass< +#ifdef WIN32 + CommonAPI::WINDummyAttributeExtension<WINDummyAttribute>, +#endif + _AttributeExtensions...> + >(abstractMiddlewareProxy); + + return returnProxy; + } + else { + return NULL; + } + } /** * \brief Build a proxy for the specified address @@ -106,8 +130,23 @@ class Factory { * @return a shared pointer to the constructed proxy */ template<template<typename ...> class _ProxyClass, typename ... _AttributeExtensions > - std::shared_ptr<_ProxyClass<_AttributeExtensions...> > - buildProxy(const std::string& serviceAddress); + std::shared_ptr< + _ProxyClass< +#ifdef WIN32 + CommonAPI::WINDummyAttributeExtension<WINDummyAttribute>, +#endif + _AttributeExtensions...> + > + buildProxy(const std::string& serviceAddress) { + std::string domain; + std::string serviceName; + std::string participantId; + if (!splitValidAddress(serviceAddress, domain, serviceName, participantId)) { + return false; + } + + return buildProxy<_ProxyClass, _AttributeExtensions...>(participantId, serviceName, domain); + } /** * \brief Build a proxy for the specified address with one extension for all attributes |