2 * This file was generated by the CommonAPI Generators.
3 * Used org.genivi.commonapi.core 2.1.5.qualifier.
4 * Used org.franca.core 0.8.10.201309262002.
6 * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 * If a copy of the MPL was not distributed with this file, You can obtain one at
8 * http://mozilla.org/MPL/2.0/.
10 #include "LegacyInterfaceDBusStubAdapter.h"
11 #include <fake/legacy/service/LegacyInterface.h>
17 std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createLegacyInterfaceDBusStubAdapter(
18 const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
19 const std::string& commonApiAddress,
20 const std::string& interfaceName,
21 const std::string& busName,
22 const std::string& objectPath,
23 const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusProxyConnection,
24 const std::shared_ptr<CommonAPI::StubBase>& stubBase) {
25 return std::make_shared<LegacyInterfaceDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
28 __attribute__((constructor)) void registerLegacyInterfaceDBusStubAdapter(void) {
29 CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(LegacyInterface::getInterfaceId(),
30 &createLegacyInterfaceDBusStubAdapter);
35 LegacyInterfaceDBusStubAdapterInternal::~LegacyInterfaceDBusStubAdapterInternal() {
36 deactivateManagedInstances();
37 LegacyInterfaceDBusStubAdapterHelper::deinit();
40 void LegacyInterfaceDBusStubAdapterInternal::deactivateManagedInstances() {
43 const char* LegacyInterfaceDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
44 static const std::string introspectionData =
45 "<method name=\"getInterfaceVersion\">\n"
46 "<arg name=\"value\" type=\"uu\" direction=\"out\" />"
48 "<method name=\"TestMethod\">\n"
49 "<arg name=\"input\" type=\"i\" direction=\"in\" />\n"
50 "<arg name=\"val1\" type=\"i\" direction=\"out\" />\n"
51 "<arg name=\"val2\" type=\"i\" direction=\"out\" />\n"
53 "<method name=\"OtherTestMethod\">\n"
54 "<arg name=\"greeting\" type=\"s\" direction=\"out\" />\n"
55 "<arg name=\"identifier\" type=\"i\" direction=\"out\" />\n"
57 "<method name=\"finish\">\n"
61 return introspectionData.c_str();
64 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
67 > getLegacyInterfaceInterfaceVersionStubDispatcher(&LegacyInterfaceStub::getInterfaceVersion, "uu");
70 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
73 std::tuple<int32_t, int32_t>
74 > testMethodStubDispatcher(&LegacyInterfaceStub::TestMethod, "ii");
75 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
78 std::tuple<std::string, int32_t>
79 > otherTestMethodStubDispatcher(&LegacyInterfaceStub::OtherTestMethod, "si");
80 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
84 > finishStubDispatcher(&LegacyInterfaceStub::finish, "");
88 const LegacyInterfaceDBusStubAdapterHelper::StubDispatcherTable& LegacyInterfaceDBusStubAdapterInternal::getStubDispatcherTable() {
89 return stubDispatcherTable_;
93 LegacyInterfaceDBusStubAdapterInternal::LegacyInterfaceDBusStubAdapterInternal(
94 const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
95 const std::string& commonApiAddress,
96 const std::string& dbusInterfaceName,
97 const std::string& dbusBusName,
98 const std::string& dbusObjectPath,
99 const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
100 const std::shared_ptr<CommonAPI::StubBase>& stub):
101 CommonAPI::DBus::DBusStubAdapter(
109 LegacyInterfaceDBusStubAdapterHelper(
116 std::dynamic_pointer_cast<LegacyInterfaceStub>(stub),
118 stubDispatcherTable_({
119 { { "TestMethod", "i" }, &fake::legacy::service::testMethodStubDispatcher },
120 { { "OtherTestMethod", "" }, &fake::legacy::service::otherTestMethodStubDispatcher },
121 { { "finish", "" }, &fake::legacy::service::finishStubDispatcher }
124 stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &fake::legacy::service::getLegacyInterfaceInterfaceVersionStubDispatcher });
127 } // namespace service
128 } // namespace legacy