increased version number to 2.1.5 and regenerated code for test fidl
[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.5.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 #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 commonapi {
27 namespace tests {
28 namespace managed {
29
30 typedef CommonAPI::DBus::DBusStubAdapterHelper<SecondRootStub> SecondRootDBusStubAdapterHelper;
31
32 class SecondRootDBusStubAdapterInternal: public SecondRootStubAdapter, public SecondRootDBusStubAdapterHelper {
33  public:
34     SecondRootDBusStubAdapterInternal(
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     ~SecondRootDBusStubAdapterInternal();
44
45
46
47     bool registerManagedStubLeafInterface(std::shared_ptr<LeafInterfaceStub>, const std::string&);
48     bool deregisterManagedStubLeafInterface(const std::string&);
49     std::set<std::string>& getLeafInterfaceInstances();
50
51     const SecondRootDBusStubAdapterHelper::StubDispatcherTable& getStubDispatcherTable();
52
53     void deactivateManagedInstances();
54
55
56  protected:
57     virtual const char* getMethodsDBusIntrospectionXmlData() const;
58     
59   private:
60     std::set<std::string> registeredLeafInterfaceInstances;
61     SecondRootDBusStubAdapterHelper::StubDispatcherTable stubDispatcherTable_;
62 };
63
64 class SecondRootDBusStubAdapter: public SecondRootDBusStubAdapterInternal, public std::enable_shared_from_this<SecondRootDBusStubAdapter> {
65 public:
66     SecondRootDBusStubAdapter(
67                          const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
68                          const std::string& commonApiAddress,
69                          const std::string& dbusInterfaceName,
70                          const std::string& dbusBusName,
71                          const std::string& dbusObjectPath,
72                          const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
73                          const std::shared_ptr<CommonAPI::StubBase>& stub) :
74             CommonAPI::DBus::DBusStubAdapter(
75                             factory,
76                             commonApiAddress,
77                             dbusInterfaceName,
78                             dbusBusName,
79                             dbusObjectPath,
80                             dbusConnection,
81                             true),
82             SecondRootDBusStubAdapterInternal(
83                             factory,
84                             commonApiAddress,
85                             dbusInterfaceName,
86                             dbusBusName,
87                             dbusObjectPath,
88                             dbusConnection,
89                             stub) { }
90 };
91
92 } // namespace managed
93 } // namespace tests
94 } // namespace commonapi
95
96 #endif // COMMONAPI_TESTS_MANAGED_Second_Root_DBUS_STUB_ADAPTER_H_