* Bug #100 - removed projecttypes.h which causes compiling conflicts
[profile/ivi/genivi/genivi-audio-manager.git] / AudioManagerDaemon / src-gen / org / genivi / NodeStateManager / ConsumerDBusStubAdapter.cpp
1 /*
2 * This file was generated by the CommonAPI Generators.
3 * Used org.genivi.commonapi.core 2.1.5.201312121915.
4 * Used org.franca.core 0.8.11.201401091023.
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 #include "ConsumerDBusStubAdapter.h"
11 #include <org/genivi/NodeStateManager/Consumer.h>
12
13 namespace org {
14 namespace genivi {
15 namespace NodeStateManager {
16
17 std::shared_ptr<CommonAPI::DBus::DBusStubAdapter> createConsumerDBusStubAdapter(
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<ConsumerDBusStubAdapter>(factory, commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase);
26 }
27
28 __attribute__((constructor)) void registerConsumerDBusStubAdapter(void) {
29     CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(Consumer::getInterfaceId(),
30                                                                &createConsumerDBusStubAdapter);
31 }
32
33
34
35 ConsumerDBusStubAdapterInternal::~ConsumerDBusStubAdapterInternal() {
36     deactivateManagedInstances();
37     ConsumerDBusStubAdapterHelper::deinit();
38 }
39
40 void ConsumerDBusStubAdapterInternal::deactivateManagedInstances() {
41 }
42
43 const char* ConsumerDBusStubAdapterInternal::getMethodsDBusIntrospectionXmlData() const {
44     static const std::string introspectionData =
45         "<method name=\"getInterfaceVersion\">\n"
46             "<arg name=\"value\" type=\"uu\" direction=\"out\" />"
47         "</method>\n"
48         "<method name=\"getBootModeAttribute\">\n"
49             "<arg name=\"value\" type=\"i\" direction=\"out\" />"
50         "</method>\n"
51         "<method name=\"getRestartReasonAttribute\">\n"
52             "<arg name=\"value\" type=\"i\" direction=\"out\" />"
53         "</method>\n"
54         "<method name=\"getShutdownReasonAttribute\">\n"
55             "<arg name=\"value\" type=\"i\" direction=\"out\" />"
56         "</method>\n"
57         "<method name=\"getWakeUpReasonAttribute\">\n"
58             "<arg name=\"value\" type=\"i\" direction=\"out\" />"
59         "</method>\n"
60         "<signal name=\"NodeApplicationMode\">\n"
61             "<arg name=\"ApplicationModeId\" type=\"i\" />\n"
62         "</signal>\n"
63         "<signal name=\"SessionStateChanged\">\n"
64             "<arg name=\"SessionStateName\" type=\"s\" />\n"
65             "<arg name=\"SeatID\" type=\"i\" />\n"
66             "<arg name=\"SessionState\" type=\"i\" />\n"
67         "</signal>\n"
68         "<signal name=\"NodeState\">\n"
69             "<arg name=\"NodeState\" type=\"i\" />\n"
70         "</signal>\n"
71         "<method name=\"GetAppHealthCount\">\n"
72             "<arg name=\"Count\" type=\"u\" direction=\"out\" />\n"
73         "</method>\n"
74         "<method name=\"LifecycleRequestComplete\">\n"
75             "<arg name=\"RequestId\" type=\"u\" direction=\"in\" />\n"
76             "<arg name=\"Status\" type=\"i\" direction=\"in\" />\n"
77             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
78         "</method>\n"
79         "<method name=\"GetInterfaceVersion\">\n"
80             "<arg name=\"Version\" type=\"u\" direction=\"out\" />\n"
81         "</method>\n"
82         "<method name=\"GetApplicationMode\">\n"
83             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
84             "<arg name=\"ApplicationModeId\" type=\"i\" direction=\"out\" />\n"
85         "</method>\n"
86         "<method name=\"UnRegisterSession\">\n"
87             "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
88             "<arg name=\"SessionOwner\" type=\"s\" direction=\"in\" />\n"
89             "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
90             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
91         "</method>\n"
92         "<method name=\"RegisterSession\">\n"
93             "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
94             "<arg name=\"SessionOwner\" type=\"s\" direction=\"in\" />\n"
95             "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
96             "<arg name=\"SessionState\" type=\"i\" direction=\"in\" />\n"
97             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
98         "</method>\n"
99         "<method name=\"UnRegisterShutdownClient\">\n"
100             "<arg name=\"BusName\" type=\"s\" direction=\"in\" />\n"
101             "<arg name=\"ObjName\" type=\"s\" direction=\"in\" />\n"
102             "<arg name=\"ShutdownMode\" type=\"u\" direction=\"in\" />\n"
103             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
104         "</method>\n"
105         "<method name=\"RegisterShutdownClient\">\n"
106             "<arg name=\"BusName\" type=\"s\" direction=\"in\" />\n"
107             "<arg name=\"ObjName\" type=\"s\" direction=\"in\" />\n"
108             "<arg name=\"ShutdownMode\" type=\"u\" direction=\"in\" />\n"
109             "<arg name=\"TimeoutMs\" type=\"u\" direction=\"in\" />\n"
110             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
111         "</method>\n"
112         "<method name=\"GetNodeState\">\n"
113             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
114             "<arg name=\"NodeStateId\" type=\"i\" direction=\"out\" />\n"
115         "</method>\n"
116         "<method name=\"GetSessionState\">\n"
117             "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
118             "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
119             "<arg name=\"SessionState\" type=\"i\" direction=\"out\" />\n"
120             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
121         "</method>\n"
122         "<method name=\"SetSessionState\">\n"
123             "<arg name=\"SessionName\" type=\"s\" direction=\"in\" />\n"
124             "<arg name=\"SessionOwner\" type=\"s\" direction=\"in\" />\n"
125             "<arg name=\"SessionState\" type=\"i\" direction=\"in\" />\n"
126             "<arg name=\"SeatID\" type=\"i\" direction=\"in\" />\n"
127             "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
128         "</method>\n"
129
130     ;
131     return introspectionData.c_str();
132 }
133
134 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
135         ConsumerStub,
136         CommonAPI::Version
137         > getConsumerInterfaceVersionStubDispatcher(&ConsumerStub::getInterfaceVersion, "uu");
138
139 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
140         ConsumerStub,
141         int32_t
142         > getBootModeAttributeStubDispatcher(&ConsumerStub::getBootModeAttribute, "i");
143
144 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
145         ConsumerStub,
146         int32_t
147         > getRestartReasonAttributeStubDispatcher(&ConsumerStub::getRestartReasonAttribute, "i");
148
149 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
150         ConsumerStub,
151         int32_t
152         > getShutdownReasonAttributeStubDispatcher(&ConsumerStub::getShutdownReasonAttribute, "i");
153
154 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
155         ConsumerStub,
156         int32_t
157         > getWakeUpReasonAttributeStubDispatcher(&ConsumerStub::getWakeUpReasonAttribute, "i");
158
159
160 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
161     ConsumerStub,
162     std::tuple<>,
163     std::tuple<uint32_t>
164     > getAppHealthCountStubDispatcher(&ConsumerStub::GetAppHealthCount, "u");
165 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
166     ConsumerStub,
167     std::tuple<uint32_t, int32_t>,
168     std::tuple<int32_t>
169     > lifecycleRequestCompleteStubDispatcher(&ConsumerStub::LifecycleRequestComplete, "i");
170 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
171     ConsumerStub,
172     std::tuple<>,
173     std::tuple<uint32_t>
174     > getInterfaceVersionStubDispatcher(&ConsumerStub::GetInterfaceVersion, "u");
175 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
176     ConsumerStub,
177     std::tuple<>,
178     std::tuple<int32_t, int32_t>
179     > getApplicationModeStubDispatcher(&ConsumerStub::GetApplicationMode, "ii");
180 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
181     ConsumerStub,
182     std::tuple<std::string, std::string, int32_t>,
183     std::tuple<int32_t>
184     > unRegisterSessionStubDispatcher(&ConsumerStub::UnRegisterSession, "i");
185 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
186     ConsumerStub,
187     std::tuple<std::string, std::string, int32_t, int32_t>,
188     std::tuple<int32_t>
189     > registerSessionStubDispatcher(&ConsumerStub::RegisterSession, "i");
190 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
191     ConsumerStub,
192     std::tuple<std::string, std::string, uint32_t>,
193     std::tuple<int32_t>
194     > unRegisterShutdownClientStubDispatcher(&ConsumerStub::UnRegisterShutdownClient, "i");
195 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
196     ConsumerStub,
197     std::tuple<std::string, std::string, uint32_t, uint32_t>,
198     std::tuple<int32_t>
199     > registerShutdownClientStubDispatcher(&ConsumerStub::RegisterShutdownClient, "i");
200 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
201     ConsumerStub,
202     std::tuple<>,
203     std::tuple<int32_t, int32_t>
204     > getNodeStateStubDispatcher(&ConsumerStub::GetNodeState, "ii");
205 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
206     ConsumerStub,
207     std::tuple<std::string, int32_t>,
208     std::tuple<int32_t, int32_t>
209     > getSessionStateStubDispatcher(&ConsumerStub::GetSessionState, "ii");
210 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
211     ConsumerStub,
212     std::tuple<std::string, std::string, int32_t, int32_t>,
213     std::tuple<int32_t>
214     > setSessionStateStubDispatcher(&ConsumerStub::SetSessionState, "i");
215
216
217 void ConsumerDBusStubAdapterInternal::fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) {
218     CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
219             ::sendSignal(
220                 *this,
221                 "NodeApplicationMode",
222                 "i",
223                 ApplicationModeId
224         );
225 }
226 void ConsumerDBusStubAdapterInternal::fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) {
227     CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<std::string, int32_t, int32_t>>
228             ::sendSignal(
229                 *this,
230                 "SessionStateChanged",
231                 "sii",
232                 SessionStateName, SeatID, SessionState
233         );
234 }
235 void ConsumerDBusStubAdapterInternal::fireNodeStateEvent(const int32_t& NodeState) {
236     CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
237             ::sendSignal(
238                 *this,
239                 "NodeState",
240                 "i",
241                 NodeState
242         );
243 }
244
245 const ConsumerDBusStubAdapterHelper::StubDispatcherTable& ConsumerDBusStubAdapterInternal::getStubDispatcherTable() {
246     return stubDispatcherTable_;
247 }
248
249
250 ConsumerDBusStubAdapterInternal::ConsumerDBusStubAdapterInternal(
251         const std::shared_ptr<CommonAPI::DBus::DBusFactory>& factory,
252         const std::string& commonApiAddress,
253         const std::string& dbusInterfaceName,
254         const std::string& dbusBusName,
255         const std::string& dbusObjectPath,
256         const std::shared_ptr<CommonAPI::DBus::DBusProxyConnection>& dbusConnection,
257         const std::shared_ptr<CommonAPI::StubBase>& stub):
258         CommonAPI::DBus::DBusStubAdapter(
259                 factory,
260                 commonApiAddress,
261                 dbusInterfaceName,
262                 dbusBusName,
263                 dbusObjectPath,
264                 dbusConnection,
265                 false),
266         ConsumerDBusStubAdapterHelper(
267             factory,
268             commonApiAddress,
269             dbusInterfaceName,
270             dbusBusName,
271             dbusObjectPath,
272             dbusConnection,
273             std::dynamic_pointer_cast<ConsumerStub>(stub),
274             false),
275         stubDispatcherTable_({
276             { { "getBootModeAttribute", "" }, &org::genivi::NodeStateManager::getBootModeAttributeStubDispatcher },
277             { { "getRestartReasonAttribute", "" }, &org::genivi::NodeStateManager::getRestartReasonAttributeStubDispatcher },
278             { { "getShutdownReasonAttribute", "" }, &org::genivi::NodeStateManager::getShutdownReasonAttributeStubDispatcher },
279             { { "getWakeUpReasonAttribute", "" }, &org::genivi::NodeStateManager::getWakeUpReasonAttributeStubDispatcher }
280             ,
281             { { "GetAppHealthCount", "" }, &org::genivi::NodeStateManager::getAppHealthCountStubDispatcher },
282             { { "LifecycleRequestComplete", "ui" }, &org::genivi::NodeStateManager::lifecycleRequestCompleteStubDispatcher },
283             { { "GetInterfaceVersion", "" }, &org::genivi::NodeStateManager::getInterfaceVersionStubDispatcher },
284             { { "GetApplicationMode", "" }, &org::genivi::NodeStateManager::getApplicationModeStubDispatcher },
285             { { "UnRegisterSession", "ssi" }, &org::genivi::NodeStateManager::unRegisterSessionStubDispatcher },
286             { { "RegisterSession", "ssii" }, &org::genivi::NodeStateManager::registerSessionStubDispatcher },
287             { { "UnRegisterShutdownClient", "ssu" }, &org::genivi::NodeStateManager::unRegisterShutdownClientStubDispatcher },
288             { { "RegisterShutdownClient", "ssuu" }, &org::genivi::NodeStateManager::registerShutdownClientStubDispatcher },
289             { { "GetNodeState", "" }, &org::genivi::NodeStateManager::getNodeStateStubDispatcher },
290             { { "GetSessionState", "si" }, &org::genivi::NodeStateManager::getSessionStateStubDispatcher },
291             { { "SetSessionState", "ssii" }, &org::genivi::NodeStateManager::setSessionStateStubDispatcher }
292             }) {
293
294     stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &org::genivi::NodeStateManager::getConsumerInterfaceVersionStubDispatcher });
295 }
296
297 } // namespace NodeStateManager
298 } // namespace genivi
299 } // namespace org