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.
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 "ConsumerDBusStubAdapter.h"
11 #include <org/genivi/NodeStateManager/Consumer.h>
15 namespace NodeStateManager {
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);
28 __attribute__((constructor)) void registerConsumerDBusStubAdapter(void) {
29 CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(Consumer::getInterfaceId(),
30 &createConsumerDBusStubAdapter);
35 ConsumerDBusStubAdapterInternal::~ConsumerDBusStubAdapterInternal() {
36 deactivateManagedInstances();
37 ConsumerDBusStubAdapterHelper::deinit();
40 void ConsumerDBusStubAdapterInternal::deactivateManagedInstances() {
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\" />"
48 "<method name=\"getBootModeAttribute\">\n"
49 "<arg name=\"value\" type=\"i\" direction=\"out\" />"
51 "<method name=\"getRestartReasonAttribute\">\n"
52 "<arg name=\"value\" type=\"i\" direction=\"out\" />"
54 "<method name=\"getShutdownReasonAttribute\">\n"
55 "<arg name=\"value\" type=\"i\" direction=\"out\" />"
57 "<method name=\"getWakeUpReasonAttribute\">\n"
58 "<arg name=\"value\" type=\"i\" direction=\"out\" />"
60 "<signal name=\"NodeApplicationMode\">\n"
61 "<arg name=\"ApplicationModeId\" type=\"i\" />\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"
68 "<signal name=\"NodeState\">\n"
69 "<arg name=\"NodeState\" type=\"i\" />\n"
71 "<method name=\"GetAppHealthCount\">\n"
72 "<arg name=\"Count\" type=\"u\" direction=\"out\" />\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"
79 "<method name=\"GetInterfaceVersion\">\n"
80 "<arg name=\"Version\" type=\"u\" direction=\"out\" />\n"
82 "<method name=\"GetApplicationMode\">\n"
83 "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
84 "<arg name=\"ApplicationModeId\" type=\"i\" direction=\"out\" />\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"
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"
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"
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"
112 "<method name=\"GetNodeState\">\n"
113 "<arg name=\"ErrorCode\" type=\"i\" direction=\"out\" />\n"
114 "<arg name=\"NodeStateId\" type=\"i\" direction=\"out\" />\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"
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"
131 return introspectionData.c_str();
134 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
137 > getConsumerInterfaceVersionStubDispatcher(&ConsumerStub::getInterfaceVersion, "uu");
139 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
142 > getBootModeAttributeStubDispatcher(&ConsumerStub::getBootModeAttribute, "i");
144 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
147 > getRestartReasonAttributeStubDispatcher(&ConsumerStub::getRestartReasonAttribute, "i");
149 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
152 > getShutdownReasonAttributeStubDispatcher(&ConsumerStub::getShutdownReasonAttribute, "i");
154 static CommonAPI::DBus::DBusGetAttributeStubDispatcher<
157 > getWakeUpReasonAttributeStubDispatcher(&ConsumerStub::getWakeUpReasonAttribute, "i");
160 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
164 > getAppHealthCountStubDispatcher(&ConsumerStub::GetAppHealthCount, "u");
165 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
167 std::tuple<uint32_t, int32_t>,
169 > lifecycleRequestCompleteStubDispatcher(&ConsumerStub::LifecycleRequestComplete, "i");
170 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
174 > getInterfaceVersionStubDispatcher(&ConsumerStub::GetInterfaceVersion, "u");
175 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
178 std::tuple<int32_t, int32_t>
179 > getApplicationModeStubDispatcher(&ConsumerStub::GetApplicationMode, "ii");
180 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
182 std::tuple<std::string, std::string, int32_t>,
184 > unRegisterSessionStubDispatcher(&ConsumerStub::UnRegisterSession, "i");
185 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
187 std::tuple<std::string, std::string, int32_t, int32_t>,
189 > registerSessionStubDispatcher(&ConsumerStub::RegisterSession, "i");
190 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
192 std::tuple<std::string, std::string, uint32_t>,
194 > unRegisterShutdownClientStubDispatcher(&ConsumerStub::UnRegisterShutdownClient, "i");
195 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
197 std::tuple<std::string, std::string, uint32_t, uint32_t>,
199 > registerShutdownClientStubDispatcher(&ConsumerStub::RegisterShutdownClient, "i");
200 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
203 std::tuple<int32_t, int32_t>
204 > getNodeStateStubDispatcher(&ConsumerStub::GetNodeState, "ii");
205 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
207 std::tuple<std::string, int32_t>,
208 std::tuple<int32_t, int32_t>
209 > getSessionStateStubDispatcher(&ConsumerStub::GetSessionState, "ii");
210 static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher<
212 std::tuple<std::string, std::string, int32_t, int32_t>,
214 > setSessionStateStubDispatcher(&ConsumerStub::SetSessionState, "i");
217 void ConsumerDBusStubAdapterInternal::fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) {
218 CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
221 "NodeApplicationMode",
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>>
230 "SessionStateChanged",
232 SessionStateName, SeatID, SessionState
235 void ConsumerDBusStubAdapterInternal::fireNodeStateEvent(const int32_t& NodeState) {
236 CommonAPI::DBus::DBusStubSignalHelper<CommonAPI::DBus::DBusSerializableArguments<int32_t>>
245 const ConsumerDBusStubAdapterHelper::StubDispatcherTable& ConsumerDBusStubAdapterInternal::getStubDispatcherTable() {
246 return stubDispatcherTable_;
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(
266 ConsumerDBusStubAdapterHelper(
273 std::dynamic_pointer_cast<ConsumerStub>(stub),
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 }
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 }
294 stubDispatcherTable_.insert({ { "getInterfaceVersion", "" }, &org::genivi::NodeStateManager::getConsumerInterfaceVersionStubDispatcher });
297 } // namespace NodeStateManager
298 } // namespace genivi