Fix for inherited interfaces and tests for that including generated code
[profile/ivi/common-api-dbus-runtime.git] / src / test / commonapi / tests / managed / SecondRootDBusStubAdapter.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 COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_STUB_ADAPTER_H_
11 #define COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_STUB_ADAPTER_H_
12
13 #include <commonapi/tests/managed/SecondRootStub.h>
14
15
16 #if !defined (COMMONAPI_INTERNAL_COMPILATION)
17 #define COMMONAPI_INTERNAL_COMPILATION
18 #endif
19
20 #include <CommonAPI/DBus/DBusStubAdapterHelper.h>
21 #include <CommonAPI/DBus/DBusStubAdapter.h>
22 #include <CommonAPI/DBus/DBusFactory.h>
23 #include <CommonAPI/DBus/DBusServicePublisher.h>
24
25 #undef COMMONAPI_INTERNAL_COMPILATION
26
27 namespace commonapi {
28 namespace tests {
29 namespace managed {
30
31 typedef CommonAPI::DBus::DBusStubAdapterHelper<SecondRootStub> SecondRootDBusStubAdapterHelper;
32
33 class SecondRootDBusStubAdapterInternal: public SecondRootStubAdapter, public SecondRootDBusStubAdapterHelper {
34  public:
35     SecondRootDBusStubAdapterInternal(
36             const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
37             const std::string& commonApiAddress,
38             const std::string& dbusInterfaceName,
39             const std::string& dbusBusName,
40             const std::string& dbusObjectPath,
41             const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
42             const std::shared_ptr<CommonAPI::StubBase>& stub);
43
44     ~SecondRootDBusStubAdapterInternal();
45
46
47     
48     bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&);
49     bool deregisterManagedStubLeafInterface(const std::string&);
50     std::set<std::string>& getLeafInterfaceInstances();
51
52     const SecondRootDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
53     
54     void deactivateManagedInstances();
55     
56
57  protected:
58     virtual const char* getMethodsDBusIntrospectionXmlData() const;
59     
60   private:
61     std::set<std::string> registeredLeafInterfaceInstances;
62     SecondRootDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
63 };
64
65 class SecondRootDBusStubAdapter: public SecondRootDBusStubAdapterInternal, public std::enable_shared_from_this<SecondRootDBusStubAdapter> {
66 public:
67     SecondRootDBusStubAdapter(
68                          const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
69                          const std::string& commonApiAddress,
70                          const std::string& dbusInterfaceName,
71                          const std::string& dbusBusName,
72                          const std::string& dbusObjectPath,
73                          const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
74                          const std::shared_ptr<CommonAPI::StubBase>& stub) :
75             CommonAPI::DBus::DBusStubAdapter(
76                             factory,
77                             commonApiAddress,
78                             dbusInterfaceName,
79                             dbusBusName,
80                             dbusObjectPath,
81                             dbusConnection,
82                             true),
83             SecondRootDBusStubAdapterInternal(
84                             factory,
85                             commonApiAddress,
86                             dbusInterfaceName,
87                             dbusBusName,
88                             dbusObjectPath,
89                             dbusConnection,
90                             stub) { }
91 };
92
93 } // namespace managed
94 } // namespace tests
95 } // namespace commonapi
96
97 #endif // COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_STUB_ADAPTER_H_