summaryrefslogtreecommitdiff
path: root/src/test/commonapi/tests/managed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/commonapi/tests/managed')
-rw-r--r--src/test/commonapi/tests/managed/BranchInterface.h3
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp2
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.h4
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp160
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.h41
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceProxy.h11
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceProxyBase.h4
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceStub.h12
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceStubDefault.cpp4
-rw-r--r--src/test/commonapi/tests/managed/BranchInterfaceStubDefault.h12
-rw-r--r--src/test/commonapi/tests/managed/LeafInterface.h3
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp2
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.h4
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp160
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.h41
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceProxy.h11
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceProxyBase.h4
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceStub.h12
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceStubDefault.cpp4
-rw-r--r--src/test/commonapi/tests/managed/LeafInterfaceStubDefault.h12
-rw-r--r--src/test/commonapi/tests/managed/RootInterface.h3
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceDBusProxy.cpp2
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceDBusProxy.h4
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp420
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.h41
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceProxy.h11
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceProxyBase.h4
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceStub.h12
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceStubDefault.cpp4
-rw-r--r--src/test/commonapi/tests/managed/RootInterfaceStubDefault.h12
-rw-r--r--src/test/commonapi/tests/managed/SecondRoot.h3
-rw-r--r--src/test/commonapi/tests/managed/SecondRootDBusProxy.cpp2
-rw-r--r--src/test/commonapi/tests/managed/SecondRootDBusProxy.h4
-rw-r--r--src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp280
-rw-r--r--src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.h41
-rw-r--r--src/test/commonapi/tests/managed/SecondRootProxy.h11
-rw-r--r--src/test/commonapi/tests/managed/SecondRootProxyBase.h3
-rw-r--r--src/test/commonapi/tests/managed/SecondRootStub.h11
-rw-r--r--src/test/commonapi/tests/managed/SecondRootStubDefault.cpp4
-rw-r--r--src/test/commonapi/tests/managed/SecondRootStubDefault.h12
40 files changed, 808 insertions, 582 deletions
diff --git a/src/test/commonapi/tests/managed/BranchInterface.h b/src/test/commonapi/tests/managed/BranchInterface.h
index 1578005..385c656 100644
--- a/src/test/commonapi/tests/managed/BranchInterface.h
+++ b/src/test/commonapi/tests/managed/BranchInterface.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp b/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp
index 0e461a6..8c557c5 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp
+++ b/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.h b/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.h
index da40530..89d520e 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.h
+++ b/src/test/commonapi/tests/managed/BranchInterfaceDBusProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,8 @@
#include <commonapi/tests/managed/BranchInterfaceProxyBase.h>
+
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp b/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp
index 48e9006..d4c0a62 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp
+++ b/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.cpp
@@ -1,89 +1,99 @@
-/*
-* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.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.
-* If a copy of the MPL was not distributed with this file, You can obtain one at
-* http://mozilla.org/MPL/2.0/.
-*/
-#include "BranchInterfaceDBusStubAdapter.h"
-#include <commonapi/tests/managed/BranchInterface.h>
+ /*
+ * 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.
+ * If a copy of the MPL was not distributed with this file, You can obtain one at
+ * http://mozilla.org/MPL/2.0/.
+ */
+ #include "BranchInterfaceDBusStubAdapter.h"
+ #include <commonapi/tests/managed/BranchInterface.h>
-namespace commonapi {
-namespace tests {
-namespace managed {
+ namespace commonapi {
+ namespace tests {
+ namespace managed {
-std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createBranchInterfaceDBusStubAdapter(
- const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
- const std::string& commonApiAddress,
- const std::string& interfaceName,
- const std::string& busName,
- const std::string& objectPath,
- const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
- const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
- return std::make_shared<BranchInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
-}
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createBranchInterfaceDBusStubAdapter(
+ const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
+ return std::make_shared<BranchInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
+ }
-__attribute__((constructor)) void registerBranchInterfaceDBusStubAdapter(void) {
- CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(BranchInterface::getInterfaceId(),
- &createBranchInterfaceDBusStubAdapter);
-}
+ __attribute__((constructor)) void registerBranchInterfaceDBusStubAdapter(void) {
+ CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(BranchInterface::getInterfaceId(),
+ &createBranchInterfaceDBusStubAdapter);
+ }
-BranchInterfaceDBusStubAdapter::BranchInterfaceDBusStubAdapter(
- 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):
- BranchInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
- dbusConnection, std::dynamic_pointer_cast<BranchInterfaceStub>(stub),
- false) {
-}
-BranchInterfaceDBusStubAdapter::~BranchInterfaceDBusStubAdapter() {
- deactivateManagedInstances();
- deinit();
- stub_.reset();
-}
-void BranchInterfaceDBusStubAdapter::deactivateManagedInstances() {
-}
+ BranchInterfaceDBusStubAdapterInternal::~BranchInterfaceDBusStubAdapterInternal() {
+ deactivateManagedInstances();
+ BranchInterfaceDBusStubAdapterHelper::deinit();
+ BranchInterfaceDBusStubAdapterHelper::stub_.reset();
+ }
+
+ void BranchInterfaceDBusStubAdapterInternal::deactivateManagedInstances() {
+ }
-const char* BranchInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const {
- static const char* introspectionData =
- "<method name=\"testBranchMethod\">\n"
- "<arg name=\"inInt\" type=\"i\" direction=\"in\" />\n"
- "<arg name=\"inString\" type=\"s\" direction=\"in\" />\n"
- "<arg name=\"methodError\" type=\"i\" direction=\"out\" />\n"
- "<arg name=\"outInt\" type=\"i\" direction=\"out\" />\n"
- "<arg name=\"outString\" type=\"s\" direction=\"out\" />\n"
- "</method>\n"
-
- ;
- return introspectionData;
-}
+ const char* BranchInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
+ static const std::string introspectionData =
+ "<method name=\"testBranchMethod\">\n"
+ "<arg name=\"inInt\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"inString\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"methodError\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"outInt\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"outString\" type=\"s\" direction=\"out\" />\n"
+ "</method>\n"
+
+ ;
+ return introspectionData.c_str();
+ }
+ static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ BranchInterfaceStub,
+ std::tuple<int32_t, std::string>,
+ std::tuple<BranchInterface::testBranchMethodError, int32_t, std::string>
+ > testBranchMethodStubDispatcher(&BranchInterfaceStub::testBranchMethod, "iis");
-static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
- BranchInterfaceStub,
- std::tuple<int32_t, std::string>,
- std::tuple<BranchInterface::testBranchMethodError, int32_t, std::string>
- > testBranchMethodStubDispatcher(&BranchInterfaceStub::testBranchMethod, "iis");
+ const BranchInterfaceDBusStubAdapterHelper::StubDispatcherTable& BranchInterfaceDBusStubAdapterInternal::getStubDispatcherTable() {
+ return stubDispatcherTable_;
+ }
+
+
+ BranchInterfaceDBusStubAdapterInternal::BranchInterfaceDBusStubAdapterInternal(
+ 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),
+ BranchInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
+ dbusConnection, std::dynamic_pointer_cast<BranchInterfaceStub>(stub),
+ false),
+ stubDispatcherTable_({
+ { { "testBranchMethod", "is" }, &commonapi::tests::managed::testBranchMethodStubDispatcher }
+ }) {
-const BranchInterfaceDBusStubAdapter::StubDispatcherTable& BranchInterfaceDBusStubAdapter::getStubDispatcherTable() {
- static const BranchInterfaceDBusStubAdapter::StubDispatcherTable stubDispatcherTable = {
- { { "testBranchMethod", "is" }, &commonapi::tests::managed::testBranchMethodStubDispatcher }
- };
- return stubDispatcherTable;
-}
+ }
-
-} // namespace managed
-} // namespace tests
-} // namespace commonapi
+ } // namespace managed
+ } // namespace tests
+ } // namespace commonapi
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.h b/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.h
index 6421978..21e46a2 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.h
+++ b/src/test/commonapi/tests/managed/BranchInterfaceDBusStubAdapter.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 <commonapi/tests/managed/BranchInterfaceStub.h>
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -29,9 +30,9 @@ namespace managed {
typedef CommonAPI::DBus::DBusStubAdapterHelper<BranchInterfaceStub> BranchInterfaceDBusStubAdapterHelper;
-class BranchInterfaceDBusStubAdapter: public BranchInterfaceStubAdapter, public BranchInterfaceDBusStubAdapterHelper {
+class BranchInterfaceDBusStubAdapterInternal: public BranchInterfaceStubAdapter, public BranchInterfaceDBusStubAdapterHelper {
public:
- BranchInterfaceDBusStubAdapter(
+ BranchInterfaceDBusStubAdapterInternal(
const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
const std::string& commonApiAddress,
const std::string& dbusInterfaceName,
@@ -40,19 +41,49 @@ class BranchInterfaceDBusStubAdapter: public BranchInterfaceStubAdapter, public
const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
const std::shared_ptr<CommonAPI::StubBase>& stub);
- ~BranchInterfaceDBusStubAdapter();
+ ~BranchInterfaceDBusStubAdapterInternal();
- const StubDispatcherTable& getStubDispatcherTable();
+ const BranchInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
void deactivateManagedInstances();
+
protected:
virtual const char* getMethodsDBusIntrospectionXmlData() const;
private:
+ BranchInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
+};
+
+class BranchInterfaceDBusStubAdapter: public BranchInterfaceDBusStubAdapterInternal, public std::enable_shared_from_this<BranchInterfaceDBusStubAdapter> {
+public:
+ BranchInterfaceDBusStubAdapter(
+ 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),
+ BranchInterfaceDBusStubAdapterInternal(
+ factory,
+ commonApiAddress,
+ dbusInterfaceName,
+ dbusBusName,
+ dbusObjectPath,
+ dbusConnection,
+ stub) { }
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceProxy.h b/src/test/commonapi/tests/managed/BranchInterfaceProxy.h
index a61efd1..6517b8d 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceProxy.h
+++ b/src/test/commonapi/tests/managed/BranchInterfaceProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 "BranchInterfaceProxyBase.h"
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -24,10 +25,14 @@ namespace tests {
namespace managed {
template <typename ... _AttributeExtensions>
-class BranchInterfaceProxy: virtual public BranchInterface, virtual public BranchInterfaceProxyBase, public _AttributeExtensions... {
- public:
+class BranchInterfaceProxy: virtual public BranchInterface, virtual public BranchInterfaceProxyBase
+, public _AttributeExtensions... {
+public:
BranchInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
~BranchInterfaceProxy();
+
+ typedef BranchInterface InterfaceType;
+
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceProxyBase.h b/src/test/commonapi/tests/managed/BranchInterfaceProxyBase.h
index d8cb010..d5a61c1 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceProxyBase.h
+++ b/src/test/commonapi/tests/managed/BranchInterfaceProxyBase.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,10 +14,12 @@
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
+#include <vector>
#include <CommonAPI/Proxy.h>
#include <functional>
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceStub.h b/src/test/commonapi/tests/managed/BranchInterfaceStub.h
index 01a01d5..160312a 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceStub.h
+++ b/src/test/commonapi/tests/managed/BranchInterfaceStub.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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>
@@ -74,14 +75,19 @@ class BranchInterfaceStubRemoteEvent {
* 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 BranchInterfaceStub : public CommonAPI::Stub<BranchInterfaceStubAdapter , BranchInterfaceStubRemoteEvent> {
- public:
+class BranchInterfaceStub : public virtual CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent> {
+public:
virtual ~BranchInterfaceStub() { }
/// This is the method that will be called on remote calls on the method testBranchMethod.
virtual void testBranchMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t inInt, std::string inString, BranchInterface::testBranchMethodError& methodError, int32_t& outInt, std::string& outString) = 0;
+
+ using CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::initStubAdapter;
+ typedef CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType;
+ typedef CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType;
+
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.cpp b/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.cpp
index ccb5c9d..039c64c 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.cpp
+++ b/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,7 +18,7 @@ BranchInterfaceStubDefault::BranchInterfaceStubDefault():
}
BranchInterfaceStubRemoteEvent* BranchInterfaceStubDefault::initStubAdapter(const std::shared_ptr<BranchInterfaceStubAdapter>& stubAdapter) {
- stubAdapter_ = stubAdapter;
+ CommonAPI::Stub<BranchInterfaceStubAdapter, BranchInterfaceStubRemoteEvent>::stubAdapter_ = stubAdapter;
return &remoteEventHandler_;
}
diff --git a/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.h b/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.h
index 5ea7ea7..90b0787 100644
--- a/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.h
+++ b/src/test/commonapi/tests/managed/BranchInterfaceStubDefault.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 COMMONAPI_TESTS_MANAGED_Branch_Interface_STUB_DEFAULT_H_
#define COMMONAPI_TESTS_MANAGED_Branch_Interface_STUB_DEFAULT_H_
+
#include <commonapi/tests/managed/BranchInterfaceStub.h>
#include <sstream>
@@ -27,8 +28,8 @@ namespace managed {
* that would be defined for this service, and/or if you do not need any non-default
* behaviour.
*/
-class BranchInterfaceStubDefault : public BranchInterfaceStub {
- public:
+class BranchInterfaceStubDefault : public virtual BranchInterfaceStub {
+public:
BranchInterfaceStubDefault();
BranchInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<BranchInterfaceStubAdapter>& stubAdapter);
@@ -40,9 +41,8 @@ class BranchInterfaceStubDefault : public BranchInterfaceStub {
- protected:
- std::shared_ptr<BranchInterfaceStubAdapter> stubAdapter_;
- private:
+protected:
+private:
class RemoteEventHandler: public BranchInterfaceStubRemoteEvent {
public:
RemoteEventHandler(BranchInterfaceStubDefault* defaultStub);
diff --git a/src/test/commonapi/tests/managed/LeafInterface.h b/src/test/commonapi/tests/managed/LeafInterface.h
index dc1d0d8..d3a05cd 100644
--- a/src/test/commonapi/tests/managed/LeafInterface.h
+++ b/src/test/commonapi/tests/managed/LeafInterface.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp b/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp
index 8274ef4..5c163da 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp
+++ b/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.h b/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.h
index 41f1e64..17fde80 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.h
+++ b/src/test/commonapi/tests/managed/LeafInterfaceDBusProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,8 @@
#include <commonapi/tests/managed/LeafInterfaceProxyBase.h>
+
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp b/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp
index d843e01..787d4ec 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp
+++ b/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.cpp
@@ -1,89 +1,99 @@
-/*
-* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.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.
-* If a copy of the MPL was not distributed with this file, You can obtain one at
-* http://mozilla.org/MPL/2.0/.
-*/
-#include "LeafInterfaceDBusStubAdapter.h"
-#include <commonapi/tests/managed/LeafInterface.h>
+ /*
+ * 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.
+ * If a copy of the MPL was not distributed with this file, You can obtain one at
+ * http://mozilla.org/MPL/2.0/.
+ */
+ #include "LeafInterfaceDBusStubAdapter.h"
+ #include <commonapi/tests/managed/LeafInterface.h>
-namespace commonapi {
-namespace tests {
-namespace managed {
+ namespace commonapi {
+ namespace tests {
+ namespace managed {
-std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createLeafInterfaceDBusStubAdapter(
- const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
- const std::string& commonApiAddress,
- const std::string& interfaceName,
- const std::string& busName,
- const std::string& objectPath,
- const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
- const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
- return std::make_shared<LeafInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
-}
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createLeafInterfaceDBusStubAdapter(
+ const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
+ return std::make_shared<LeafInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
+ }
-__attribute__((constructor)) void registerLeafInterfaceDBusStubAdapter(void) {
- CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(LeafInterface::getInterfaceId(),
- &createLeafInterfaceDBusStubAdapter);
-}
+ __attribute__((constructor)) void registerLeafInterfaceDBusStubAdapter(void) {
+ CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(LeafInterface::getInterfaceId(),
+ &createLeafInterfaceDBusStubAdapter);
+ }
-LeafInterfaceDBusStubAdapter::LeafInterfaceDBusStubAdapter(
- 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):
- LeafInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
- dbusConnection, std::dynamic_pointer_cast<LeafInterfaceStub>(stub),
- false) {
-}
-LeafInterfaceDBusStubAdapter::~LeafInterfaceDBusStubAdapter() {
- deactivateManagedInstances();
- deinit();
- stub_.reset();
-}
-void LeafInterfaceDBusStubAdapter::deactivateManagedInstances() {
-}
+ LeafInterfaceDBusStubAdapterInternal::~LeafInterfaceDBusStubAdapterInternal() {
+ deactivateManagedInstances();
+ LeafInterfaceDBusStubAdapterHelper::deinit();
+ LeafInterfaceDBusStubAdapterHelper::stub_.reset();
+ }
+
+ void LeafInterfaceDBusStubAdapterInternal::deactivateManagedInstances() {
+ }
-const char* LeafInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const {
- static const char* introspectionData =
- "<method name=\"testLeafMethod\">\n"
- "<arg name=\"inInt\" type=\"i\" direction=\"in\" />\n"
- "<arg name=\"inString\" type=\"s\" direction=\"in\" />\n"
- "<arg name=\"methodError\" type=\"i\" direction=\"out\" />\n"
- "<arg name=\"outInt\" type=\"i\" direction=\"out\" />\n"
- "<arg name=\"outString\" type=\"s\" direction=\"out\" />\n"
- "</method>\n"
-
- ;
- return introspectionData;
-}
+ const char* LeafInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
+ static const std::string introspectionData =
+ "<method name=\"testLeafMethod\">\n"
+ "<arg name=\"inInt\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"inString\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"methodError\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"outInt\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"outString\" type=\"s\" direction=\"out\" />\n"
+ "</method>\n"
+
+ ;
+ return introspectionData.c_str();
+ }
+ static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ LeafInterfaceStub,
+ std::tuple<int32_t, std::string>,
+ std::tuple<LeafInterface::testLeafMethodError, int32_t, std::string>
+ > testLeafMethodStubDispatcher(&LeafInterfaceStub::testLeafMethod, "iis");
-static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
- LeafInterfaceStub,
- std::tuple<int32_t, std::string>,
- std::tuple<LeafInterface::testLeafMethodError, int32_t, std::string>
- > testLeafMethodStubDispatcher(&LeafInterfaceStub::testLeafMethod, "iis");
+ const LeafInterfaceDBusStubAdapterHelper::StubDispatcherTable& LeafInterfaceDBusStubAdapterInternal::getStubDispatcherTable() {
+ return stubDispatcherTable_;
+ }
+
+
+ LeafInterfaceDBusStubAdapterInternal::LeafInterfaceDBusStubAdapterInternal(
+ 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),
+ LeafInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
+ dbusConnection, std::dynamic_pointer_cast<LeafInterfaceStub>(stub),
+ false),
+ stubDispatcherTable_({
+ { { "testLeafMethod", "is" }, &commonapi::tests::managed::testLeafMethodStubDispatcher }
+ }) {
-const LeafInterfaceDBusStubAdapter::StubDispatcherTable& LeafInterfaceDBusStubAdapter::getStubDispatcherTable() {
- static const LeafInterfaceDBusStubAdapter::StubDispatcherTable stubDispatcherTable = {
- { { "testLeafMethod", "is" }, &commonapi::tests::managed::testLeafMethodStubDispatcher }
- };
- return stubDispatcherTable;
-}
+ }
-
-} // namespace managed
-} // namespace tests
-} // namespace commonapi
+ } // namespace managed
+ } // namespace tests
+ } // namespace commonapi
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.h b/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.h
index 797ea90..f60c9b5 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.h
+++ b/src/test/commonapi/tests/managed/LeafInterfaceDBusStubAdapter.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 <commonapi/tests/managed/LeafInterfaceStub.h>
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -29,9 +30,9 @@ namespace managed {
typedef CommonAPI::DBus::DBusStubAdapterHelper<LeafInterfaceStub> LeafInterfaceDBusStubAdapterHelper;
-class LeafInterfaceDBusStubAdapter: public LeafInterfaceStubAdapter, public LeafInterfaceDBusStubAdapterHelper {
+class LeafInterfaceDBusStubAdapterInternal: public LeafInterfaceStubAdapter, public LeafInterfaceDBusStubAdapterHelper {
public:
- LeafInterfaceDBusStubAdapter(
+ LeafInterfaceDBusStubAdapterInternal(
const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
const std::string& commonApiAddress,
const std::string& dbusInterfaceName,
@@ -40,19 +41,49 @@ class LeafInterfaceDBusStubAdapter: public LeafInterfaceStubAdapter, public Leaf
const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
const std::shared_ptr<CommonAPI::StubBase>& stub);
- ~LeafInterfaceDBusStubAdapter();
+ ~LeafInterfaceDBusStubAdapterInternal();
- const StubDispatcherTable& getStubDispatcherTable();
+ const LeafInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
void deactivateManagedInstances();
+
protected:
virtual const char* getMethodsDBusIntrospectionXmlData() const;
private:
+ LeafInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
+};
+
+class LeafInterfaceDBusStubAdapter: public LeafInterfaceDBusStubAdapterInternal, public std::enable_shared_from_this<LeafInterfaceDBusStubAdapter> {
+public:
+ LeafInterfaceDBusStubAdapter(
+ 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),
+ LeafInterfaceDBusStubAdapterInternal(
+ factory,
+ commonApiAddress,
+ dbusInterfaceName,
+ dbusBusName,
+ dbusObjectPath,
+ dbusConnection,
+ stub) { }
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceProxy.h b/src/test/commonapi/tests/managed/LeafInterfaceProxy.h
index 94f8bcb..7275950 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceProxy.h
+++ b/src/test/commonapi/tests/managed/LeafInterfaceProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 "LeafInterfaceProxyBase.h"
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -24,10 +25,14 @@ namespace tests {
namespace managed {
template <typename ... _AttributeExtensions>
-class LeafInterfaceProxy: virtual public LeafInterface, virtual public LeafInterfaceProxyBase, public _AttributeExtensions... {
- public:
+class LeafInterfaceProxy: virtual public LeafInterface, virtual public LeafInterfaceProxyBase
+, public _AttributeExtensions... {
+public:
LeafInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
~LeafInterfaceProxy();
+
+ typedef LeafInterface InterfaceType;
+
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceProxyBase.h b/src/test/commonapi/tests/managed/LeafInterfaceProxyBase.h
index 7e8d718..16df4d7 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceProxyBase.h
+++ b/src/test/commonapi/tests/managed/LeafInterfaceProxyBase.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,10 +14,12 @@
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
+#include <vector>
#include <CommonAPI/Proxy.h>
#include <functional>
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceStub.h b/src/test/commonapi/tests/managed/LeafInterfaceStub.h
index d31561b..95ef485 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceStub.h
+++ b/src/test/commonapi/tests/managed/LeafInterfaceStub.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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>
@@ -74,14 +75,19 @@ class LeafInterfaceStubRemoteEvent {
* 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 LeafInterfaceStub : public CommonAPI::Stub<LeafInterfaceStubAdapter , LeafInterfaceStubRemoteEvent> {
- public:
+class LeafInterfaceStub : public virtual CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent> {
+public:
virtual ~LeafInterfaceStub() { }
/// This is the method that will be called on remote calls on the method testLeafMethod.
virtual void testLeafMethod(const std::shared_ptr<CommonAPI::ClientId> clientId, int32_t inInt, std::string inString, LeafInterface::testLeafMethodError& methodError, int32_t& outInt, std::string& outString) = 0;
+
+ using CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::initStubAdapter;
+ typedef CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType;
+ typedef CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType;
+
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.cpp b/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.cpp
index 01dd58b..f653e18 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.cpp
+++ b/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,7 +18,7 @@ LeafInterfaceStubDefault::LeafInterfaceStubDefault():
}
LeafInterfaceStubRemoteEvent* LeafInterfaceStubDefault::initStubAdapter(const std::shared_ptr<LeafInterfaceStubAdapter>& stubAdapter) {
- stubAdapter_ = stubAdapter;
+ CommonAPI::Stub<LeafInterfaceStubAdapter, LeafInterfaceStubRemoteEvent>::stubAdapter_ = stubAdapter;
return &remoteEventHandler_;
}
diff --git a/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.h b/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.h
index fdedc9c..e9227b8 100644
--- a/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.h
+++ b/src/test/commonapi/tests/managed/LeafInterfaceStubDefault.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 COMMONAPI_TESTS_MANAGED_Leaf_Interface_STUB_DEFAULT_H_
#define COMMONAPI_TESTS_MANAGED_Leaf_Interface_STUB_DEFAULT_H_
+
#include <commonapi/tests/managed/LeafInterfaceStub.h>
#include <sstream>
@@ -27,8 +28,8 @@ namespace managed {
* that would be defined for this service, and/or if you do not need any non-default
* behaviour.
*/
-class LeafInterfaceStubDefault : public LeafInterfaceStub {
- public:
+class LeafInterfaceStubDefault : public virtual LeafInterfaceStub {
+public:
LeafInterfaceStubDefault();
LeafInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<LeafInterfaceStubAdapter>& stubAdapter);
@@ -40,9 +41,8 @@ class LeafInterfaceStubDefault : public LeafInterfaceStub {
- protected:
- std::shared_ptr<LeafInterfaceStubAdapter> stubAdapter_;
- private:
+protected:
+private:
class RemoteEventHandler: public LeafInterfaceStubRemoteEvent {
public:
RemoteEventHandler(LeafInterfaceStubDefault* defaultStub);
diff --git a/src/test/commonapi/tests/managed/RootInterface.h b/src/test/commonapi/tests/managed/RootInterface.h
index f239090..7894869 100644
--- a/src/test/commonapi/tests/managed/RootInterface.h
+++ b/src/test/commonapi/tests/managed/RootInterface.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
@@ -13,6 +13,7 @@
#include <set>
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
diff --git a/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.cpp b/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.cpp
index b73d399..b7eb845 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.cpp
+++ b/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
diff --git a/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.h b/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.h
index cf00826..07f5798 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.h
+++ b/src/test/commonapi/tests/managed/RootInterfaceDBusProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,8 @@
#include <commonapi/tests/managed/RootInterfaceProxyBase.h>
+
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
diff --git a/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp b/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp
index 7857f58..66a9965 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp
+++ b/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.cpp
@@ -1,205 +1,215 @@
-/*
-* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.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.
-* If a copy of the MPL was not distributed with this file, You can obtain one at
-* http://mozilla.org/MPL/2.0/.
-*/
-#include "RootInterfaceDBusStubAdapter.h"
-#include <commonapi/tests/managed/RootInterface.h>
-
-namespace commonapi {
-namespace tests {
-namespace managed {
-
-std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createRootInterfaceDBusStubAdapter(
- const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
- const std::string& commonApiAddress,
- const std::string& interfaceName,
- const std::string& busName,
- const std::string& objectPath,
- const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
- const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
- return std::make_shared<RootInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
-}
-
-__attribute__((constructor)) void registerRootInterfaceDBusStubAdapter(void) {
- CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(RootInterface::getInterfaceId(),
- &createRootInterfaceDBusStubAdapter);
-}
-
-RootInterfaceDBusStubAdapter::RootInterfaceDBusStubAdapter(
- 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):
- RootInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
- dbusConnection, std::dynamic_pointer_cast<RootInterfaceStub>(stub),
- true) {
-}
-
-RootInterfaceDBusStubAdapter::~RootInterfaceDBusStubAdapter() {
- deactivateManagedInstances();
- deinit();
- stub_.reset();
-}
-
-void RootInterfaceDBusStubAdapter::deactivateManagedInstances() {
- for(std::set<std::string>::iterator iter = registeredLeafInterfaceInstances.begin();
- iter != registeredLeafInterfaceInstances.end(); ++iter) {
- deregisterManagedStubLeafInterface(*iter);
- }
- for(std::set<std::string>::iterator iter = registeredBranchInterfaceInstances.begin();
- iter != registeredBranchInterfaceInstances.end(); ++iter) {
- deregisterManagedStubBranchInterface(*iter);
- }
-}
-
-const char* RootInterfaceDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const {
- static const char* introspectionData =
- "<method name=\"testRootMethod\">\n"
- "<arg name=\"inInt\" type=\"i\" direction=\"in\" />\n"
- "<arg name=\"inString\" type=\"s\" direction=\"in\" />\n"
- "<arg name=\"methodError\" type=\"i\" direction=\"out\" />\n"
- "<arg name=\"outInt\" type=\"i\" direction=\"out\" />\n"
- "<arg name=\"outString\" type=\"s\" direction=\"out\" />\n"
- "</method>\n"
-
- ;
- return introspectionData;
-}
-
-
-
-static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
- RootInterfaceStub,
- std::tuple<int32_t, std::string>,
- std::tuple<RootInterface::testRootMethodError, int32_t, std::string>
- > testRootMethodStubDispatcher(&RootInterfaceStub::testRootMethod, "iis");
-
-
-
-const RootInterfaceDBusStubAdapter::StubDispatcherTable& RootInterfaceDBusStubAdapter::getStubDispatcherTable() {
- static const RootInterfaceDBusStubAdapter::StubDispatcherTable stubDispatcherTable = {
- { { "testRootMethod", "is" }, &commonapi::tests::managed::testRootMethodStubDispatcher }
- };
- return stubDispatcherTable;
-}
-
-
-bool RootInterfaceDBusStubAdapter::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> stub, const std::string& instance) {
- if (registeredLeafInterfaceInstances.find(instance) == registeredLeafInterfaceInstances.end()) {
- std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
-
- std::string interfaceName;
- std::string connectionName;
- std::string objectPath;
-
- CommonAPI::DBus::DBusAddressTranslator::getInstance().searchForDBusAddress(
- commonApiAddress,
- interfaceName,
- connectionName,
- objectPath);
-
- if (objectPath.compare(0, dbusObjectPath_.length(), dbusObjectPath_) == 0) {
- auto dbusStubAdapter = factory_->createDBusStubAdapter(stub, "commonapi.tests.managed.LeafInterface",
- instance, "commonapi.tests.managed.LeafInterface", "local");
-
- bool success = CommonAPI::DBus::DBusServicePublisher::getInstance()->registerManagedService(dbusStubAdapter);
- if (success) {
- bool isServiceExportSuccessful = dbusConnection_->getDBusObjectManager()->exportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
- if (isServiceExportSuccessful) {
- registeredLeafInterfaceInstances.insert(instance);
- return true;
- } else {
- const bool isManagedDeregistrationSuccessful =
- CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(
- commonApiAddress);
- }
- }
- }
- }
- return false;
-}
-
-bool RootInterfaceDBusStubAdapter::deregisterManagedStubLeafInterface(const std::string& instance) {
- std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
- if (registeredLeafInterfaceInstances.find(instance) != registeredLeafInterfaceInstances.end()) {
- std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> dbusStubAdapter =
- CommonAPI::DBus::DBusServicePublisher::getInstance()->getRegisteredService(commonApiAddress);
- if (dbusStubAdapter != nullptr) {
- dbusConnection_->getDBusObjectManager()->unexportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
- CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(commonApiAddress);
- registeredLeafInterfaceInstances.erase(instance);
- return true;
- }
- }
- return false;
-}
-
-std::set<std::string>& RootInterfaceDBusStubAdapter::getLeafInterfaceInstances() {
- return registeredLeafInterfaceInstances;
-}
-
-bool RootInterfaceDBusStubAdapter::registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub> stub, const std::string& instance) {
- if (registeredBranchInterfaceInstances.find(instance) == registeredBranchInterfaceInstances.end()) {
- std::string commonApiAddress = "local:commonapi.tests.managed.BranchInterface:" + instance;
-
- std::string interfaceName;
- std::string connectionName;
- std::string objectPath;
-
- CommonAPI::DBus::DBusAddressTranslator::getInstance().searchForDBusAddress(
- commonApiAddress,
- interfaceName,
- connectionName,
- objectPath);
-
- if (objectPath.compare(0, dbusObjectPath_.length(), dbusObjectPath_) == 0) {
- auto dbusStubAdapter = factory_->createDBusStubAdapter(stub, "commonapi.tests.managed.BranchInterface",
- instance, "commonapi.tests.managed.BranchInterface", "local");
-
- bool success = CommonAPI::DBus::DBusServicePublisher::getInstance()->registerManagedService(dbusStubAdapter);
- if (success) {
- bool isServiceExportSuccessful = dbusConnection_->getDBusObjectManager()->exportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
- if (isServiceExportSuccessful) {
- registeredBranchInterfaceInstances.insert(instance);
- return true;
- } else {
- const bool isManagedDeregistrationSuccessful =
- CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(
- commonApiAddress);
- }
- }
- }
- }
- return false;
-}
-
-bool RootInterfaceDBusStubAdapter::deregisterManagedStubBranchInterface(const std::string& instance) {
- std::string commonApiAddress = "local:commonapi.tests.managed.BranchInterface:" + instance;
- if (registeredBranchInterfaceInstances.find(instance) != registeredBranchInterfaceInstances.end()) {
- std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> dbusStubAdapter =
- CommonAPI::DBus::DBusServicePublisher::getInstance()->getRegisteredService(commonApiAddress);
- if (dbusStubAdapter != nullptr) {
- dbusConnection_->getDBusObjectManager()->unexportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
- CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(commonApiAddress);
- registeredBranchInterfaceInstances.erase(instance);
- return true;
- }
- }
- return false;
-}
-
-std::set<std::string>& RootInterfaceDBusStubAdapter::getBranchInterfaceInstances() {
- return registeredBranchInterfaceInstances;
-}
-
-} // namespace managed
-} // namespace tests
-} // namespace commonapi
+ /*
+ * 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.
+ * If a copy of the MPL was not distributed with this file, You can obtain one at
+ * http://mozilla.org/MPL/2.0/.
+ */
+ #include "RootInterfaceDBusStubAdapter.h"
+ #include <commonapi/tests/managed/RootInterface.h>
+
+ namespace commonapi {
+ namespace tests {
+ namespace managed {
+
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createRootInterfaceDBusStubAdapter(
+ const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
+ return std::make_shared<RootInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
+ }
+
+ __attribute__((constructor)) void registerRootInterfaceDBusStubAdapter(void) {
+ CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(RootInterface::getInterfaceId(),
+ &createRootInterfaceDBusStubAdapter);
+ }
+
+
+
+ RootInterfaceDBusStubAdapterInternal::~RootInterfaceDBusStubAdapterInternal() {
+ deactivateManagedInstances();
+ RootInterfaceDBusStubAdapterHelper::deinit();
+ RootInterfaceDBusStubAdapterHelper::stub_.reset();
+ }
+
+ void RootInterfaceDBusStubAdapterInternal::deactivateManagedInstances() {
+ for(std::set<std::string>::iterator iter = registeredLeafInterfaceInstances.begin();
+ iter != registeredLeafInterfaceInstances.end(); ++iter) {
+ deregisterManagedStubLeafInterface(*iter);
+ }
+ for(std::set<std::string>::iterator iter = registeredBranchInterfaceInstances.begin();
+ iter != registeredBranchInterfaceInstances.end(); ++iter) {
+ deregisterManagedStubBranchInterface(*iter);
+ }
+ }
+
+ const char* RootInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
+ static const std::string introspectionData =
+ "<method name=\"testRootMethod\">\n"
+ "<arg name=\"inInt\" type=\"i\" direction=\"in\" />\n"
+ "<arg name=\"inString\" type=\"s\" direction=\"in\" />\n"
+ "<arg name=\"methodError\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"outInt\" type=\"i\" direction=\"out\" />\n"
+ "<arg name=\"outString\" type=\"s\" direction=\"out\" />\n"
+ "</method>\n"
+
+ ;
+ return introspectionData.c_str();
+ }
+
+
+ static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
+ RootInterfaceStub,
+ std::tuple<int32_t, std::string>,
+ std::tuple<RootInterface::testRootMethodError, int32_t, std::string>
+ > testRootMethodStubDispatcher(&RootInterfaceStub::testRootMethod, "iis");
+
+
+
+ const RootInterfaceDBusStubAdapterHelper::StubDispatcherTable& RootInterfaceDBusStubAdapterInternal::getStubDispatcherTable() {
+ return stubDispatcherTable_;
+ }
+
+
+ bool RootInterfaceDBusStubAdapterInternal::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> stub, const std::string& instance) {
+ if (registeredLeafInterfaceInstances.find(instance) == registeredLeafInterfaceInstances.end()) {
+ std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
+
+ std::string interfaceName;
+ std::string connectionName;
+ std::string objectPath;
+
+ CommonAPI::DBus::DBusAddressTranslator::getInstance().searchForDBusAddress(
+ commonApiAddress,
+ interfaceName,
+ connectionName,
+ objectPath);
+
+ if (objectPath.compare(0, dbusObjectPath_.length(), dbusObjectPath_) == 0) {
+ auto dbusStubAdapter = factory_->createDBusStubAdapter(stub, "commonapi.tests.managed.LeafInterface",
+ instance, "commonapi.tests.managed.LeafInterface", "local");
+
+ bool success = CommonAPI::DBus::DBusServicePublisher::getInstance()->registerManagedService(dbusStubAdapter);
+ if (success) {
+ bool isServiceExportSuccessful = dbusConnection_->getDBusObjectManager()->exportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
+ if (isServiceExportSuccessful) {
+ registeredLeafInterfaceInstances.insert(instance);
+ return true;
+ } else {
+ const bool isManagedDeregistrationSuccessful =
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(
+ commonApiAddress);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ bool RootInterfaceDBusStubAdapterInternal::deregisterManagedStubLeafInterface(const std::string& instance) {
+ std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
+ if (registeredLeafInterfaceInstances.find(instance) != registeredLeafInterfaceInstances.end()) {
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> dbusStubAdapter =
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->getRegisteredService(commonApiAddress);
+ if (dbusStubAdapter != nullptr) {
+ dbusConnection_->getDBusObjectManager()->unexportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(commonApiAddress);
+ registeredLeafInterfaceInstances.erase(instance);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ std::set<std::string>& RootInterfaceDBusStubAdapterInternal::getLeafInterfaceInstances() {
+ return registeredLeafInterfaceInstances;
+ }
+
+ bool RootInterfaceDBusStubAdapterInternal::registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub> stub, const std::string& instance) {
+ if (registeredBranchInterfaceInstances.find(instance) == registeredBranchInterfaceInstances.end()) {
+ std::string commonApiAddress = "local:commonapi.tests.managed.BranchInterface:" + instance;
+
+ std::string interfaceName;
+ std::string connectionName;
+ std::string objectPath;
+
+ CommonAPI::DBus::DBusAddressTranslator::getInstance().searchForDBusAddress(
+ commonApiAddress,
+ interfaceName,
+ connectionName,
+ objectPath);
+
+ if (objectPath.compare(0, dbusObjectPath_.length(), dbusObjectPath_) == 0) {
+ auto dbusStubAdapter = factory_->createDBusStubAdapter(stub, "commonapi.tests.managed.BranchInterface",
+ instance, "commonapi.tests.managed.BranchInterface", "local");
+
+ bool success = CommonAPI::DBus::DBusServicePublisher::getInstance()->registerManagedService(dbusStubAdapter);
+ if (success) {
+ bool isServiceExportSuccessful = dbusConnection_->getDBusObjectManager()->exportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
+ if (isServiceExportSuccessful) {
+ registeredBranchInterfaceInstances.insert(instance);
+ return true;
+ } else {
+ const bool isManagedDeregistrationSuccessful =
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(
+ commonApiAddress);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ bool RootInterfaceDBusStubAdapterInternal::deregisterManagedStubBranchInterface(const std::string& instance) {
+ std::string commonApiAddress = "local:commonapi.tests.managed.BranchInterface:" + instance;
+ if (registeredBranchInterfaceInstances.find(instance) != registeredBranchInterfaceInstances.end()) {
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> dbusStubAdapter =
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->getRegisteredService(commonApiAddress);
+ if (dbusStubAdapter != nullptr) {
+ dbusConnection_->getDBusObjectManager()->unexportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(commonApiAddress);
+ registeredBranchInterfaceInstances.erase(instance);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ std::set<std::string>& RootInterfaceDBusStubAdapterInternal::getBranchInterfaceInstances() {
+ return registeredBranchInterfaceInstances;
+ }
+
+ RootInterfaceDBusStubAdapterInternal::RootInterfaceDBusStubAdapterInternal(
+ 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,
+ true),
+ RootInterfaceDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
+ dbusConnection, std::dynamic_pointer_cast<RootInterfaceStub>(stub),
+ true),
+ stubDispatcherTable_({
+ { { "testRootMethod", "is" }, &commonapi::tests::managed::testRootMethodStubDispatcher }
+ }) {
+
+ }
+
+ } // namespace managed
+ } // namespace tests
+ } // namespace commonapi
diff --git a/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.h b/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.h
index f8973a4..01ef3a4 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.h
+++ b/src/test/commonapi/tests/managed/RootInterfaceDBusStubAdapter.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 <commonapi/tests/managed/RootInterfaceStub.h>
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -29,9 +30,9 @@ namespace managed {
typedef CommonAPI::DBus::DBusStubAdapterHelper<RootInterfaceStub> RootInterfaceDBusStubAdapterHelper;
-class RootInterfaceDBusStubAdapter: public RootInterfaceStubAdapter, public RootInterfaceDBusStubAdapterHelper {
+class RootInterfaceDBusStubAdapterInternal: public RootInterfaceStubAdapter, public RootInterfaceDBusStubAdapterHelper {
public:
- RootInterfaceDBusStubAdapter(
+ RootInterfaceDBusStubAdapterInternal(
const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
const std::string& commonApiAddress,
const std::string& dbusInterfaceName,
@@ -40,7 +41,7 @@ class RootInterfaceDBusStubAdapter: public RootInterfaceStubAdapter, public Root
const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
const std::shared_ptr<CommonAPI::StubBase>& stub);
- ~RootInterfaceDBusStubAdapter();
+ ~RootInterfaceDBusStubAdapterInternal();
@@ -51,9 +52,10 @@ class RootInterfaceDBusStubAdapter: public RootInterfaceStubAdapter, public Root
bool deregisterManagedStubBranchInterface(const std::string&);
std::set<std::string>& getBranchInterfaceInstances();
- const StubDispatcherTable& getStubDispatcherTable();
+ const RootInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
void deactivateManagedInstances();
+
protected:
virtual const char* getMethodsDBusIntrospectionXmlData() const;
@@ -61,6 +63,35 @@ class RootInterfaceDBusStubAdapter: public RootInterfaceStubAdapter, public Root
private:
std::set<std::string> registeredLeafInterfaceInstances;
std::set<std::string> registeredBranchInterfaceInstances;
+ RootInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
+};
+
+class RootInterfaceDBusStubAdapter: public RootInterfaceDBusStubAdapterInternal, public std::enable_shared_from_this<RootInterfaceDBusStubAdapter> {
+public:
+ RootInterfaceDBusStubAdapter(
+ 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,
+ true),
+ RootInterfaceDBusStubAdapterInternal(
+ factory,
+ commonApiAddress,
+ dbusInterfaceName,
+ dbusBusName,
+ dbusObjectPath,
+ dbusConnection,
+ stub) { }
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/RootInterfaceProxy.h b/src/test/commonapi/tests/managed/RootInterfaceProxy.h
index b01808e..672c0d5 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceProxy.h
+++ b/src/test/commonapi/tests/managed/RootInterfaceProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 "RootInterfaceProxyBase.h"
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -24,10 +25,14 @@ namespace tests {
namespace managed {
template <typename ... _AttributeExtensions>
-class RootInterfaceProxy: virtual public RootInterface, virtual public RootInterfaceProxyBase, public _AttributeExtensions... {
- public:
+class RootInterfaceProxy: virtual public RootInterface, virtual public RootInterfaceProxyBase
+, public _AttributeExtensions... {
+public:
RootInterfaceProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
~RootInterfaceProxy();
+
+ typedef RootInterface InterfaceType;
+
diff --git a/src/test/commonapi/tests/managed/RootInterfaceProxyBase.h b/src/test/commonapi/tests/managed/RootInterfaceProxyBase.h
index 7ebe721..550093f 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceProxyBase.h
+++ b/src/test/commonapi/tests/managed/RootInterfaceProxyBase.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
@@ -13,6 +13,7 @@
#include "RootInterface.h"
+
#include <commonapi/tests/managed/BranchInterfaceStub.h>
#include <commonapi/tests/managed/LeafInterfaceStub.h>
@@ -20,6 +21,7 @@
#define COMMONAPI_INTERNAL_COMPILATION
#endif
+#include <vector>
#include <CommonAPI/ProxyManager.h>
#include <CommonAPI/Proxy.h>
diff --git a/src/test/commonapi/tests/managed/RootInterfaceStub.h b/src/test/commonapi/tests/managed/RootInterfaceStub.h
index 749a26a..0dbd088 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceStub.h
+++ b/src/test/commonapi/tests/managed/RootInterfaceStub.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
@@ -21,6 +21,7 @@
#define COMMONAPI_INTERNAL_COMPILATION
#endif
+#include <vector>
#include <CommonAPI/Stub.h>
@@ -82,8 +83,8 @@ class RootInterfaceStubRemoteEvent {
* 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 RootInterfaceStub : public CommonAPI::Stub<RootInterfaceStubAdapter , RootInterfaceStubRemoteEvent> {
- public:
+class RootInterfaceStub : public virtual CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent> {
+public:
virtual ~RootInterfaceStub() { }
@@ -96,6 +97,11 @@ class RootInterfaceStub : public CommonAPI::Stub<RootInterfaceStubAdapter , Root
virtual bool registerManagedStubBranchInterface(std::shared_ptr<BranchInterfaceStub>, const std::string&) = 0;
virtual bool deregisterManagedStubBranchInterface(const std::string&) = 0;
virtual std::set<std::string>& getBranchInterfaceInstances() = 0;
+
+ using CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::initStubAdapter;
+ typedef CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::StubAdapterType StubAdapterType;
+ typedef CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType;
+
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/RootInterfaceStubDefault.cpp b/src/test/commonapi/tests/managed/RootInterfaceStubDefault.cpp
index a87861d..cf09dc0 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceStubDefault.cpp
+++ b/src/test/commonapi/tests/managed/RootInterfaceStubDefault.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,7 +19,7 @@ RootInterfaceStubDefault::RootInterfaceStubDefault():
}
RootInterfaceStubRemoteEvent* RootInterfaceStubDefault::initStubAdapter(const std::shared_ptr<RootInterfaceStubAdapter>& stubAdapter) {
- stubAdapter_ = stubAdapter;
+ CommonAPI::Stub<RootInterfaceStubAdapter, RootInterfaceStubRemoteEvent>::stubAdapter_ = stubAdapter;
return &remoteEventHandler_;
}
diff --git a/src/test/commonapi/tests/managed/RootInterfaceStubDefault.h b/src/test/commonapi/tests/managed/RootInterfaceStubDefault.h
index 6fdba46..1379a82 100644
--- a/src/test/commonapi/tests/managed/RootInterfaceStubDefault.h
+++ b/src/test/commonapi/tests/managed/RootInterfaceStubDefault.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 COMMONAPI_TESTS_MANAGED_Root_Interface_STUB_DEFAULT_H_
#define COMMONAPI_TESTS_MANAGED_Root_Interface_STUB_DEFAULT_H_
+
#include <commonapi/tests/managed/RootInterfaceStub.h>
#include <sstream>
@@ -27,8 +28,8 @@ namespace managed {
* that would be defined for this service, and/or if you do not need any non-default
* behaviour.
*/
-class RootInterfaceStubDefault : public RootInterfaceStub {
- public:
+class RootInterfaceStubDefault : public virtual RootInterfaceStub {
+public:
RootInterfaceStubDefault();
RootInterfaceStubRemoteEvent* initStubAdapter(const std::shared_ptr<RootInterfaceStubAdapter>& stubAdapter);
@@ -48,9 +49,8 @@ class RootInterfaceStubDefault : public RootInterfaceStub {
bool deregisterManagedStubBranchInterface(const std::string&);
std::set<std::string>& getBranchInterfaceInstances();
- protected:
- std::shared_ptr<RootInterfaceStubAdapter> stubAdapter_;
- private:
+protected:
+private:
class RemoteEventHandler: public RootInterfaceStubRemoteEvent {
public:
RemoteEventHandler(RootInterfaceStubDefault* defaultStub);
diff --git a/src/test/commonapi/tests/managed/SecondRoot.h b/src/test/commonapi/tests/managed/SecondRoot.h
index 0b55364..4104797 100644
--- a/src/test/commonapi/tests/managed/SecondRoot.h
+++ b/src/test/commonapi/tests/managed/SecondRoot.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
@@ -13,6 +13,7 @@
#include <set>
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
diff --git a/src/test/commonapi/tests/managed/SecondRootDBusProxy.cpp b/src/test/commonapi/tests/managed/SecondRootDBusProxy.cpp
index b1eb31a..f43fde1 100644
--- a/src/test/commonapi/tests/managed/SecondRootDBusProxy.cpp
+++ b/src/test/commonapi/tests/managed/SecondRootDBusProxy.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
diff --git a/src/test/commonapi/tests/managed/SecondRootDBusProxy.h b/src/test/commonapi/tests/managed/SecondRootDBusProxy.h
index 4942927..81f752e 100644
--- a/src/test/commonapi/tests/managed/SecondRootDBusProxy.h
+++ b/src/test/commonapi/tests/managed/SecondRootDBusProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,8 @@
#include <commonapi/tests/managed/SecondRootProxyBase.h>
+
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
diff --git a/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp b/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp
index e7e7719..fffe746 100644
--- a/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp
+++ b/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.cpp
@@ -1,135 +1,145 @@
-/*
-* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.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.
-* If a copy of the MPL was not distributed with this file, You can obtain one at
-* http://mozilla.org/MPL/2.0/.
-*/
-#include "SecondRootDBusStubAdapter.h"
-#include <commonapi/tests/managed/SecondRoot.h>
-
-namespace commonapi {
-namespace tests {
-namespace managed {
-
-std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createSecondRootDBusStubAdapter(
- const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
- const std::string& commonApiAddress,
- const std::string& interfaceName,
- const std::string& busName,
- const std::string& objectPath,
- const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
- const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
- return std::make_shared<SecondRootDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
-}
-
-__attribute__((constructor)) void registerSecondRootDBusStubAdapter(void) {
- CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(SecondRoot::getInterfaceId(),
- &createSecondRootDBusStubAdapter);
-}
-
-SecondRootDBusStubAdapter::SecondRootDBusStubAdapter(
- 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):
- SecondRootDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
- dbusConnection, std::dynamic_pointer_cast<SecondRootStub>(stub),
- true) {
-}
-
-SecondRootDBusStubAdapter::~SecondRootDBusStubAdapter() {
- deactivateManagedInstances();
- deinit();
- stub_.reset();
-}
-
-void SecondRootDBusStubAdapter::deactivateManagedInstances() {
- for(std::set<std::string>::iterator iter = registeredLeafInterfaceInstances.begin();
- iter != registeredLeafInterfaceInstances.end(); ++iter) {
- deregisterManagedStubLeafInterface(*iter);
- }
-}
-
-const char* SecondRootDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const {
- static const char* introspectionData =
-
- ""
- ;
- return introspectionData;
-}
-
-
-
-
-
-
-const SecondRootDBusStubAdapter::StubDispatcherTable& SecondRootDBusStubAdapter::getStubDispatcherTable() {
- static const SecondRootDBusStubAdapter::StubDispatcherTable stubDispatcherTable = {
- };
- return stubDispatcherTable;
-}
-
-
-bool SecondRootDBusStubAdapter::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> stub, const std::string& instance) {
- if (registeredLeafInterfaceInstances.find(instance) == registeredLeafInterfaceInstances.end()) {
- std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
-
- std::string interfaceName;
- std::string connectionName;
- std::string objectPath;
-
- CommonAPI::DBus::DBusAddressTranslator::getInstance().searchForDBusAddress(
- commonApiAddress,
- interfaceName,
- connectionName,
- objectPath);
-
- if (objectPath.compare(0, dbusObjectPath_.length(), dbusObjectPath_) == 0) {
- auto dbusStubAdapter = factory_->createDBusStubAdapter(stub, "commonapi.tests.managed.LeafInterface",
- instance, "commonapi.tests.managed.LeafInterface", "local");
-
- bool success = CommonAPI::DBus::DBusServicePublisher::getInstance()->registerManagedService(dbusStubAdapter);
- if (success) {
- bool isServiceExportSuccessful = dbusConnection_->getDBusObjectManager()->exportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
- if (isServiceExportSuccessful) {
- registeredLeafInterfaceInstances.insert(instance);
- return true;
- } else {
- const bool isManagedDeregistrationSuccessful =
- CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(
- commonApiAddress);
- }
- }
- }
- }
- return false;
-}
-
-bool SecondRootDBusStubAdapter::deregisterManagedStubLeafInterface(const std::string& instance) {
- std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
- if (registeredLeafInterfaceInstances.find(instance) != registeredLeafInterfaceInstances.end()) {
- std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> dbusStubAdapter =
- CommonAPI::DBus::DBusServicePublisher::getInstance()->getRegisteredService(commonApiAddress);
- if (dbusStubAdapter != nullptr) {
- dbusConnection_->getDBusObjectManager()->unexportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
- CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(commonApiAddress);
- registeredLeafInterfaceInstances.erase(instance);
- return true;
- }
- }
- return false;
-}
-
-std::set<std::string>& SecondRootDBusStubAdapter::getLeafInterfaceInstances() {
- return registeredLeafInterfaceInstances;
-}
-
-} // namespace managed
-} // namespace tests
-} // namespace commonapi
+ /*
+ * 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.
+ * If a copy of the MPL was not distributed with this file, You can obtain one at
+ * http://mozilla.org/MPL/2.0/.
+ */
+ #include "SecondRootDBusStubAdapter.h"
+ #include <commonapi/tests/managed/SecondRoot.h>
+
+ namespace commonapi {
+ namespace tests {
+ namespace managed {
+
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createSecondRootDBusStubAdapter(
+ const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
+ const std::string& commonApiAddress,
+ const std::string& interfaceName,
+ const std::string& busName,
+ const std::string& objectPath,
+ const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
+ const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
+ return std::make_shared<SecondRootDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
+ }
+
+ __attribute__((constructor)) void registerSecondRootDBusStubAdapter(void) {
+ CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(SecondRoot::getInterfaceId(),
+ &createSecondRootDBusStubAdapter);
+ }
+
+
+
+ SecondRootDBusStubAdapterInternal::~SecondRootDBusStubAdapterInternal() {
+ deactivateManagedInstances();
+ SecondRootDBusStubAdapterHelper::deinit();
+ SecondRootDBusStubAdapterHelper::stub_.reset();
+ }
+
+ void SecondRootDBusStubAdapterInternal::deactivateManagedInstances() {
+ for(std::set<std::string>::iterator iter = registeredLeafInterfaceInstances.begin();
+ iter != registeredLeafInterfaceInstances.end(); ++iter) {
+ deregisterManagedStubLeafInterface(*iter);
+ }
+ }
+
+ const char* SecondRootDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
+ static const std::string introspectionData =
+
+ ""
+ ;
+ return introspectionData.c_str();
+ }
+
+
+
+
+
+ const SecondRootDBusStubAdapterHelper::StubDispatcherTable& SecondRootDBusStubAdapterInternal::getStubDispatcherTable() {
+ return stubDispatcherTable_;
+ }
+
+
+ bool SecondRootDBusStubAdapterInternal::registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub> stub, const std::string& instance) {
+ if (registeredLeafInterfaceInstances.find(instance) == registeredLeafInterfaceInstances.end()) {
+ std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
+
+ std::string interfaceName;
+ std::string connectionName;
+ std::string objectPath;
+
+ CommonAPI::DBus::DBusAddressTranslator::getInstance().searchForDBusAddress(
+ commonApiAddress,
+ interfaceName,
+ connectionName,
+ objectPath);
+
+ if (objectPath.compare(0, dbusObjectPath_.length(), dbusObjectPath_) == 0) {
+ auto dbusStubAdapter = factory_->createDBusStubAdapter(stub, "commonapi.tests.managed.LeafInterface",
+ instance, "commonapi.tests.managed.LeafInterface", "local");
+
+ bool success = CommonAPI::DBus::DBusServicePublisher::getInstance()->registerManagedService(dbusStubAdapter);
+ if (success) {
+ bool isServiceExportSuccessful = dbusConnection_->getDBusObjectManager()->exportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
+ if (isServiceExportSuccessful) {
+ registeredLeafInterfaceInstances.insert(instance);
+ return true;
+ } else {
+ const bool isManagedDeregistrationSuccessful =
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(
+ commonApiAddress);
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ bool SecondRootDBusStubAdapterInternal::deregisterManagedStubLeafInterface(const std::string& instance) {
+ std::string commonApiAddress = "local:commonapi.tests.managed.LeafInterface:" + instance;
+ if (registeredLeafInterfaceInstances.find(instance) != registeredLeafInterfaceInstances.end()) {
+ std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> dbusStubAdapter =
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->getRegisteredService(commonApiAddress);
+ if (dbusStubAdapter != nullptr) {
+ dbusConnection_->getDBusObjectManager()->unexportManagedDBusStubAdapter(dbusObjectPath_, dbusStubAdapter);
+ CommonAPI::DBus::DBusServicePublisher::getInstance()->unregisterManagedService(commonApiAddress);
+ registeredLeafInterfaceInstances.erase(instance);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ std::set<std::string>& SecondRootDBusStubAdapterInternal::getLeafInterfaceInstances() {
+ return registeredLeafInterfaceInstances;
+ }
+
+ SecondRootDBusStubAdapterInternal::SecondRootDBusStubAdapterInternal(
+ 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,
+ true),
+ SecondRootDBusStubAdapterHelper(factory, commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath,
+ dbusConnection, std::dynamic_pointer_cast<SecondRootStub>(stub),
+ true),
+ stubDispatcherTable_({
+ }) {
+
+ }
+
+ } // namespace managed
+ } // namespace tests
+ } // namespace commonapi
diff --git a/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.h b/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.h
index 8fdb7dc..fc646db 100644
--- a/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.h
+++ b/src/test/commonapi/tests/managed/SecondRootDBusStubAdapter.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 <commonapi/tests/managed/SecondRootStub.h>
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -29,9 +30,9 @@ namespace managed {
typedef CommonAPI::DBus::DBusStubAdapterHelper<SecondRootStub> SecondRootDBusStubAdapterHelper;
-class SecondRootDBusStubAdapter: public SecondRootStubAdapter, public SecondRootDBusStubAdapterHelper {
+class SecondRootDBusStubAdapterInternal: public SecondRootStubAdapter, public SecondRootDBusStubAdapterHelper {
public:
- SecondRootDBusStubAdapter(
+ SecondRootDBusStubAdapterInternal(
const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
const std::string& commonApiAddress,
const std::string& dbusInterfaceName,
@@ -40,7 +41,7 @@ class SecondRootDBusStubAdapter: public SecondRootStubAdapter, public SecondRoot
const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
const std::shared_ptr<CommonAPI::StubBase>& stub);
- ~SecondRootDBusStubAdapter();
+ ~SecondRootDBusStubAdapterInternal();
@@ -48,15 +49,45 @@ class SecondRootDBusStubAdapter: public SecondRootStubAdapter, public SecondRoot
bool deregisterManagedStubLeafInterface(const std::string&);
std::set<std::string>& getLeafInterfaceInstances();
- const StubDispatcherTable& getStubDispatcherTable();
+ const SecondRootDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
void deactivateManagedInstances();
+
protected:
virtual const char* getMethodsDBusIntrospectionXmlData() const;
private:
std::set<std::string> registeredLeafInterfaceInstances;
+ SecondRootDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
+};
+
+class SecondRootDBusStubAdapter: public SecondRootDBusStubAdapterInternal, public std::enable_shared_from_this<SecondRootDBusStubAdapter> {
+public:
+ SecondRootDBusStubAdapter(
+ 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,
+ true),
+ SecondRootDBusStubAdapterInternal(
+ factory,
+ commonApiAddress,
+ dbusInterfaceName,
+ dbusBusName,
+ dbusObjectPath,
+ dbusConnection,
+ stub) { }
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/SecondRootProxy.h b/src/test/commonapi/tests/managed/SecondRootProxy.h
index 2eb8cc1..fa0cb20 100644
--- a/src/test/commonapi/tests/managed/SecondRootProxy.h
+++ b/src/test/commonapi/tests/managed/SecondRootProxy.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 "SecondRootProxyBase.h"
+
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
#define COMMONAPI_INTERNAL_COMPILATION
#endif
@@ -24,10 +25,14 @@ namespace tests {
namespace managed {
template <typename ... _AttributeExtensions>
-class SecondRootProxy: virtual public SecondRoot, virtual public SecondRootProxyBase, public _AttributeExtensions... {
- public:
+class SecondRootProxy: virtual public SecondRoot, virtual public SecondRootProxyBase
+, public _AttributeExtensions... {
+public:
SecondRootProxy(std::shared_ptr<CommonAPI::Proxy> delegate);
~SecondRootProxy();
+
+ typedef SecondRoot InterfaceType;
+
diff --git a/src/test/commonapi/tests/managed/SecondRootProxyBase.h b/src/test/commonapi/tests/managed/SecondRootProxyBase.h
index 2c6d805..8006139 100644
--- a/src/test/commonapi/tests/managed/SecondRootProxyBase.h
+++ b/src/test/commonapi/tests/managed/SecondRootProxyBase.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
@@ -13,6 +13,7 @@
#include "SecondRoot.h"
+
#include <commonapi/tests/managed/LeafInterfaceStub.h>
#if !defined (COMMONAPI_INTERNAL_COMPILATION)
diff --git a/src/test/commonapi/tests/managed/SecondRootStub.h b/src/test/commonapi/tests/managed/SecondRootStub.h
index 7789e5d..98a73cb 100644
--- a/src/test/commonapi/tests/managed/SecondRootStub.h
+++ b/src/test/commonapi/tests/managed/SecondRootStub.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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.
@@ -78,8 +78,8 @@ class SecondRootStubRemoteEvent {
* 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 SecondRootStub : public CommonAPI::Stub<SecondRootStubAdapter , SecondRootStubRemoteEvent> {
- public:
+class SecondRootStub : public virtual CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent> {
+public:
virtual ~SecondRootStub() { }
@@ -87,6 +87,11 @@ class SecondRootStub : public CommonAPI::Stub<SecondRootStubAdapter , SecondRoot
virtual bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&) = 0;
virtual bool deregisterManagedStubLeafInterface(const std::string&) = 0;
virtual std::set<std::string>& getLeafInterfaceInstances() = 0;
+
+ using CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::initStubAdapter;
+ typedef CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::StubAdapterType StubAdapterType;
+ typedef CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::RemoteEventHandlerType RemoteEventHandlerType;
+
};
} // namespace managed
diff --git a/src/test/commonapi/tests/managed/SecondRootStubDefault.cpp b/src/test/commonapi/tests/managed/SecondRootStubDefault.cpp
index 2e1f42b..51feea1 100644
--- a/src/test/commonapi/tests/managed/SecondRootStubDefault.cpp
+++ b/src/test/commonapi/tests/managed/SecondRootStubDefault.cpp
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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,7 +19,7 @@ SecondRootStubDefault::SecondRootStubDefault():
}
SecondRootStubRemoteEvent* SecondRootStubDefault::initStubAdapter(const std::shared_ptr<SecondRootStubAdapter>& stubAdapter) {
- stubAdapter_ = stubAdapter;
+ CommonAPI::Stub<SecondRootStubAdapter, SecondRootStubRemoteEvent>::stubAdapter_ = stubAdapter;
return &remoteEventHandler_;
}
diff --git a/src/test/commonapi/tests/managed/SecondRootStubDefault.h b/src/test/commonapi/tests/managed/SecondRootStubDefault.h
index 7c3a99d..daaca19 100644
--- a/src/test/commonapi/tests/managed/SecondRootStubDefault.h
+++ b/src/test/commonapi/tests/managed/SecondRootStubDefault.h
@@ -1,6 +1,6 @@
/*
* This file was generated by the CommonAPI Generators.
-* Used org.genivi.commonapi.core 2.1.3.qualifier.
+* 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 COMMONAPI_TESTS_MANAGED_Second_Root_STUB_DEFAULT_H_
#define COMMONAPI_TESTS_MANAGED_Second_Root_STUB_DEFAULT_H_
+
#include <commonapi/tests/managed/SecondRootStub.h>
#include <sstream>
@@ -27,8 +28,8 @@ namespace managed {
* that would be defined for this service, and/or if you do not need any non-default
* behaviour.
*/
-class SecondRootStubDefault : public SecondRootStub {
- public:
+class SecondRootStubDefault : public virtual SecondRootStub {
+public:
SecondRootStubDefault();
SecondRootStubRemoteEvent* initStubAdapter(const std::shared_ptr<SecondRootStubAdapter>& stubAdapter);
@@ -41,9 +42,8 @@ class SecondRootStubDefault : public SecondRootStub {
bool deregisterManagedStubLeafInterface(const std::string&);
std::set<std::string>& getLeafInterfaceInstances();
- protected:
- std::shared_ptr<SecondRootStubAdapter> stubAdapter_;
- private:
+protected:
+private:
class RemoteEventHandler: public SecondRootStubRemoteEvent {
public:
RemoteEventHandler(SecondRootStubDefault* defaultStub);