diff options
Diffstat (limited to 'src/test/fake/legacy')
10 files changed, 146 insertions, 74 deletions
diff --git a/src/test/fake/legacy/service/LegacyInterface.h b/src/test/fake/legacy/service/LegacyInterface.h index eab3aed..7350d2c 100644 --- a/src/test/fake/legacy/service/LegacyInterface.h +++ b/src/test/fake/legacy/service/LegacyInterface.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -12,6 +12,7 @@ + #if !defined (COMMONAPI_INTERNAL_COMPILATION) #define COMMONAPI_INTERNAL_COMPILATION #endif @@ -53,7 +54,7 @@ namespace CommonAPI { namespace std { //hashes for types - + //hashes for error types } diff --git a/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.cpp b/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.cpp index ed0eda0..3d4dad8 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.cpp +++ b/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.cpp @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -47,7 +47,7 @@ void LegacyInterfaceDBusProxy::TestMethod(const int32_t& input, CommonAPI::CallS *this, "TestMethod", "i", - input, + input, callStatus , val1, val2); } diff --git a/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.h b/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.h index 7baf090..9d1c2d9 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.h +++ b/src/test/fake/legacy/service/LegacyInterfaceDBusProxy.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -47,13 +47,13 @@ class LegacyInterfaceDBusProxy: virtual public LegacyInterfaceProxyBase, virtual virtual std::future<CommonAPI::CallStatus> OtherTestMethodAsync(OtherTestMethodAsyncCallback callback); virtual void finish(CommonAPI::CallStatus& callStatus); virtual std::future<CommonAPI::CallStatus> finishAsync(FinishAsyncCallback callback); - + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; private: - + }; diff --git a/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.cpp b/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.cpp index f1cffc8..06599ef 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.cpp +++ b/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.cpp @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -30,30 +30,22 @@ __attribute__((constructor)) void registerLegacyInterfaceDBusStubAdapter(void) { &createLegacyInterfaceDBusStubAdapter); } -LegacyInterfaceDBusStubAdapter::LegacyInterfaceDBusStubAdapter( - const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, - const std::string& commonApiAddress, - const std::string& dbusInterfaceName, - const std::string& dbusBusName, - const std::string& dbusObjectPath, - const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, - const std::shared_ptr<CommonAPI::StubBase>& stub): - LegacyInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath, - dbusConnection, std::dynamic_pointer_cast<LegacyInterfaceStub>(stub), - false) { -} -LegacyInterfaceDBusStubAdapter::~LegacyInterfaceDBusStubAdapter() { + +LegacyInterfaceDBusStubAdapterInternal::~LegacyInterfaceDBusStubAdapterInternal() { deactivateManagedInstances(); - deinit(); - stub_.reset(); + LegacyInterfaceDBusStubAdapterHelper::deinit(); + LegacyInterfaceDBusStubAdapterHelper::stub_.reset(); } -void LegacyInterfaceDBusStubAdapter::deactivateManagedInstances() { +void LegacyInterfaceDBusStubAdapterInternal::deactivateManagedInstances() { } -const char* LegacyInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const { - static const char* introspectionData = +const char* LegacyInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const { + static const std::string introspectionData = + "<method name=\"getInterfaceVersion\">\n" + "<arg name=\"value\" type=\"uu\" direction=\"out\" />" + "</method>\n" "<method name=\"TestMethod\">\n" "<arg name=\"input\" type=\"i\" direction=\"in\" />\n" "<arg name=\"val1\" type=\"i\" direction=\"out\" />\n" @@ -65,11 +57,15 @@ const char* LegacyInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() "</method>\n" "<method name=\"finish\">\n" "</method>\n" - + ; - return introspectionData; + return introspectionData.c_str(); } +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + LegacyInterfaceStub, + CommonAPI::Version + > getLegacyInterfaceInterfaceVersionStubDispatcher(&LegacyInterfaceStub::getInterfaceVersion, "uu"); static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< @@ -90,15 +86,44 @@ static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< -const LegacyInterfaceDBusStubAdapter::StubDispatcherTable& LegacyInterfaceDBusStubAdapter::getStubDispatcherTable() { - static const LegacyInterfaceDBusStubAdapter::StubDispatcherTable stubDispatcherTable = { +const LegacyInterfaceDBusStubAdapterHelper::StubDispatcherTable& LegacyInterfaceDBusStubAdapterInternal::getStubDispatcherTable() { + return stubDispatcherTable_; +} + + +LegacyInterfaceDBusStubAdapterInternal::LegacyInterfaceDBusStubAdapterInternal( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub): + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + LegacyInterfaceDBusStubAdapterHelper( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + std::dynamic_pointer_cast<LegacyInterfaceStub>(stub), + false), + stubDispatcherTable_({ { { "TestMethod", "i" }, &fake::legacy::service::testMethodStubDispatcher }, { { "OtherTestMethod", "" }, &fake::legacy::service::otherTestMethodStubDispatcher }, { { "finish", "" }, &fake::legacy::service::finishStubDispatcher } - }; - return stubDispatcherTable; -} + }) { + stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &fake::legacy::service::getLegacyInterfaceInterfaceVersionStubDispatcher }); +} } // namespace service } // namespace legacy diff --git a/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.h b/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.h index 0337006..e5c5894 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.h +++ b/src/test/fake/legacy/service/LegacyInterfaceDBusStubAdapter.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -29,9 +29,9 @@ namespace service { typedef CommonAPI::DBus::DBusStubAdapterHelper<LegacyInterfaceStub> LegacyInterfaceDBusStubAdapterHelper; -class LegacyInterfaceDBusStubAdapter: public LegacyInterfaceStubAdapter, public LegacyInterfaceDBusStubAdapterHelper { +class LegacyInterfaceDBusStubAdapterInternal: public LegacyInterfaceStubAdapter, public LegacyInterfaceDBusStubAdapterHelper { public: - LegacyInterfaceDBusStubAdapter( + LegacyInterfaceDBusStubAdapterInternal( const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, const std::string& commonApiAddress, const std::string& dbusInterfaceName, @@ -40,19 +40,49 @@ class LegacyInterfaceDBusStubAdapter: public LegacyInterfaceStubAdapter, public const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, const std::shared_ptr<CommonAPI::StubBase>& stub); - ~LegacyInterfaceDBusStubAdapter(); + ~LegacyInterfaceDBusStubAdapterInternal(); - - const StubDispatcherTable& getStubDispatcherTable(); - + + const LegacyInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable(); + void deactivateManagedInstances(); + protected: virtual const char* getMethodsDBusIntrospectionXmlData() const; private: + LegacyInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_; +}; + +class LegacyInterfaceDBusStubAdapter: public LegacyInterfaceDBusStubAdapterInternal, public std::enable_shared_from_this<LegacyInterfaceDBusStubAdapter> { +public: + LegacyInterfaceDBusStubAdapter( + const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory, + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection, + const std::shared_ptr<CommonAPI::StubBase>& stub) : + CommonAPI::DBus::DBusStubAdapter( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + false), + LegacyInterfaceDBusStubAdapterInternal( + factory, + commonApiAddress, + dbusInterfaceName, + dbusBusName, + dbusObjectPath, + dbusConnection, + stub) { } }; } // namespace service diff --git a/src/test/fake/legacy/service/LegacyInterfaceProxy.h b/src/test/fake/legacy/service/LegacyInterfaceProxy.h index f5c108c..5c6ae9d 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceProxy.h +++ b/src/test/fake/legacy/service/LegacyInterfaceProxy.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -12,6 +12,7 @@ #include "LegacyInterfaceProxyBase.h" + #if !defined (COMMONAPI_INTERNAL_COMPILATION) #define COMMONAPI_INTERNAL_COMPILATION #endif @@ -24,12 +25,14 @@ namespace legacy { namespace service { template <typename ... _AttributeExtensions> -class LegacyInterfaceProxy: virtual public LegacyInterface, virtual public LegacyInterfaceProxyBase, public _AttributeExtensions... { - public: +class LegacyInterfaceProxy: virtual public LegacyInterface, virtual public LegacyInterfaceProxyBase +, public _AttributeExtensions... { +public: LegacyInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate); ~LegacyInterfaceProxy(); - typedef typename fake::legacy::service::LegacyInterface InterfaceType; + typedef LegacyInterface InterfaceType; + @@ -93,7 +96,7 @@ class LegacyInterfaceProxy: virtual public LegacyInterface, virtual public Legac * It will provide the same value for CallStatus as will be handed to the callback. */ virtual std::future<CommonAPI::CallStatus> finishAsync(FinishAsyncCallback callback); - + /** * Returns the CommonAPI address of the remote partner this proxy communicates with. @@ -223,7 +226,6 @@ CommonAPI::InterfaceVersionAttribute& LegacyInterfaceProxy<_AttributeExtensions. return delegate_->getInterfaceVersionAttribute(); } - } // namespace service } // namespace legacy diff --git a/src/test/fake/legacy/service/LegacyInterfaceProxyBase.h b/src/test/fake/legacy/service/LegacyInterfaceProxyBase.h index dbb4baa..41399bf 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceProxyBase.h +++ b/src/test/fake/legacy/service/LegacyInterfaceProxyBase.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -18,6 +18,7 @@ #define COMMONAPI_INTERNAL_COMPILATION #endif +#include <vector> #include <CommonAPI/Proxy.h> #include <functional> diff --git a/src/test/fake/legacy/service/LegacyInterfaceStub.h b/src/test/fake/legacy/service/LegacyInterfaceStub.h index c32c66e..6fbb0fd 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceStub.h +++ b/src/test/fake/legacy/service/LegacyInterfaceStub.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -19,6 +19,7 @@ #define COMMONAPI_INTERNAL_COMPILATION #endif +#include <vector> #include <CommonAPI/Stub.h> @@ -37,10 +38,9 @@ namespace service { class LegacyInterfaceStubAdapter: virtual public CommonAPI::StubAdapter, public LegacyInterface { public: - - + + virtual void deactivateManagedInstances() = 0; - protected: /** * Defines properties for storing the ClientIds of clients / proxies that have @@ -74,9 +74,10 @@ class LegacyInterfaceStubRemoteEvent { * This class and the one above are the ones an application developer needs to have * a look at if he wants to implement a service. */ -class LegacyInterfaceStub : public CommonAPI::Stub<LegacyInterfaceStubAdapter , LegacyInterfaceStubRemoteEvent> { - public: +class LegacyInterfaceStub : public virtual CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent> { +public: virtual ~LegacyInterfaceStub() { } + virtual const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) = 0; /// This is the method that will be called on remote calls on the method TestMethod. @@ -85,7 +86,10 @@ class LegacyInterfaceStub : public CommonAPI::Stub<LegacyInterfaceStubAdapter , virtual void OtherTestMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, std::string& greeting, int32_t& identifier) = 0; /// This is the method that will be called on remote calls on the method finish. virtual void finish(const std::shared_ptr<CommonAPI::ClientId> clientId) = 0; - + + using CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::initStubAdapter; + typedef CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType; + typedef CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType; }; } // namespace service diff --git a/src/test/fake/legacy/service/LegacyInterfaceStubDefault.cpp b/src/test/fake/legacy/service/LegacyInterfaceStubDefault.cpp index db345e7..4fb1de8 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceStubDefault.cpp +++ b/src/test/fake/legacy/service/LegacyInterfaceStubDefault.cpp @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -14,11 +14,16 @@ namespace legacy { namespace service { LegacyInterfaceStubDefault::LegacyInterfaceStubDefault(): - remoteEventHandler_(this) { + remoteEventHandler_(this), + interfaceVersion_(LegacyInterface::getInterfaceVersion()) { +} + +const CommonAPI::Version& LegacyInterfaceStubDefault::getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId) { + return interfaceVersion_; } LegacyInterfaceStubRemoteEvent* LegacyInterfaceStubDefault::initStubAdapter(const std::shared_ptr<LegacyInterfaceStubAdapter>& stubAdapter) { - stubAdapter_ = stubAdapter; + CommonAPI::Stub<LegacyInterfaceStubAdapter, LegacyInterfaceStubRemoteEvent>::stubAdapter_ = stubAdapter; return &remoteEventHandler_; } diff --git a/src/test/fake/legacy/service/LegacyInterfaceStubDefault.h b/src/test/fake/legacy/service/LegacyInterfaceStubDefault.h index 854aab5..6f50b07 100644 --- a/src/test/fake/legacy/service/LegacyInterfaceStubDefault.h +++ b/src/test/fake/legacy/service/LegacyInterfaceStubDefault.h @@ -1,6 +1,6 @@ /* -* This file was generated by the CommonAPI Generators. -* Used org.genivi.commonapi.core 2.1.3.qualifier. +* This file was generated by the CommonAPI Generators. +* Used org.genivi.commonapi.core 2.1.4.qualifier. * Used org.franca.core 0.8.10.201309262002. * * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -10,6 +10,7 @@ #ifndef FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_DEFAULT_H_ #define FAKE_LEGACY_SERVICE_Legacy_Interface_STUB_DEFAULT_H_ + #include <fake/legacy/service/LegacyInterfaceStub.h> #include <sstream> @@ -27,12 +28,14 @@ namespace service { * that would be defined for this service, and/or if you do not need any non-default * behaviour. */ -class LegacyInterfaceStubDefault : public LegacyInterfaceStub { - public: +class LegacyInterfaceStubDefault : public virtual LegacyInterfaceStub { +public: LegacyInterfaceStubDefault(); LegacyInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<LegacyInterfaceStubAdapter>& stubAdapter); + const CommonAPI::Version& getInterfaceVersion(std::shared_ptr<CommonAPI::ClientId> clientId); + virtual void TestMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t input, int32_t& val1, int32_t& val2); virtual void TestMethod(int32_t input, int32_t& val1, int32_t& val2); @@ -44,11 +47,10 @@ class LegacyInterfaceStubDefault : public LegacyInterfaceStub { virtual void finish(); - - protected: - std::shared_ptr<LegacyInterfaceStubAdapter> stubAdapter_; - private: + +protected: +private: class RemoteEventHandler: public LegacyInterfaceStubRemoteEvent { public: RemoteEventHandler(LegacyInterfaceStubDefault* defaultStub); @@ -60,6 +62,8 @@ class LegacyInterfaceStubDefault : public LegacyInterfaceStub { RemoteEventHandler remoteEventHandler_; + + CommonAPI::Version interfaceVersion_; }; } // namespace service |