e5c589406d69e19364d29eca8cda93bd60e33fe7
[profile/ivi/common-api-dbus-runtime.git] / src / test / fake / legacy / service / LegacyInterfaceDBusStubAdapter.h
1 /*
2 * This file was generated by the CommonAPI Generators.
3 * Used org.genivi.commonapi.core 2.1.4.qualifier.
4 * Used org.franca.core 0.8.10.201309262002.
5 *
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/.
9 */
10 #ifndef FAKE_LEGACY_SERVICE_Legacy_Interface_DBUS_STUB_ADAPTER_H_
11 #define FAKE_LEGACY_SERVICE_Legacy_Interface_DBUS_STUB_ADAPTER_H_
12
13 #include <fake/legacy/service/LegacyInterfaceStub.h>
14
15 #if !defined (COMMONAPI_INTERNAL_COMPILATION)
16 #define COMMONAPI_INTERNAL_COMPILATION
17 #endif
18
19 #include <CommonAPI/DBus/DBusStubAdapterHelper.h>
20 #include <CommonAPI/DBus/DBusStubAdapter.h>
21 #include <CommonAPI/DBus/DBusFactory.h>
22 #include <CommonAPI/DBus/DBusServicePublisher.h>
23
24 #undef COMMONAPI_INTERNAL_COMPILATION
25
26 namespace fake {
27 namespace legacy {
28 namespace service {
29
30 typedef CommonAPI::DBus::DBusStubAdapterHelper<LegacyInterfaceStub> LegacyInterfaceDBusStubAdapterHelper;
31
32 class LegacyInterfaceDBusStubAdapterInternal: public LegacyInterfaceStubAdapter, public LegacyInterfaceDBusStubAdapterHelper {
33  public:
34     LegacyInterfaceDBusStubAdapterInternal(
35             const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
36             const std::string& commonApiAddress,
37             const std::string& dbusInterfaceName,
38             const std::string& dbusBusName,
39             const std::string& dbusObjectPath,
40             const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
41             const std::shared_ptr<CommonAPI::StubBase>& stub);
42
43     ~LegacyInterfaceDBusStubAdapterInternal();
44
45
46
47
48     const LegacyInterfaceDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
49
50     void deactivateManagedInstances();
51
52
53  protected:
54     virtual const char* getMethodsDBusIntrospectionXmlData() const;
55     
56   private:
57     LegacyInterfaceDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
58 };
59
60 class LegacyInterfaceDBusStubAdapter: public LegacyInterfaceDBusStubAdapterInternal, public std::enable_shared_from_this<LegacyInterfaceDBusStubAdapter> {
61 public:
62     LegacyInterfaceDBusStubAdapter(
63                          const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
64                          const std::string& commonApiAddress,
65                          const std::string& dbusInterfaceName,
66                          const std::string& dbusBusName,
67                          const std::string& dbusObjectPath,
68                          const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
69                          const std::shared_ptr<CommonAPI::StubBase>& stub) :
70             CommonAPI::DBus::DBusStubAdapter(
71                             factory,
72                             commonApiAddress,
73                             dbusInterfaceName,
74                             dbusBusName,
75                             dbusObjectPath,
76                             dbusConnection,
77                             false),
78             LegacyInterfaceDBusStubAdapterInternal(
79                             factory,
80                             commonApiAddress,
81                             dbusInterfaceName,
82                             dbusBusName,
83                             dbusObjectPath,
84                             dbusConnection,
85                             stub) { }
86 };
87
88 } // namespace service
89 } // namespace legacy
90 } // namespace fake
91
92 #endif // FAKE_LEGACY_SERVICE_Legacy_Interface_DBUS_STUB_ADAPTER_H_