From a2edae5cee4254b933f42399edc0e092abd4f5cf Mon Sep 17 00:00:00 2001 From: Aleksandar Donchev Date: Mon, 2 Sep 2013 11:57:28 +0200 Subject: *PluginCommandInterfaceCAPI, PluginRoutingInterfaceCAPI, NodeStateCommunicatorCAPI with unit tests first version. Choosing between DBUS and Common-API via cmake. CommonAPI - legacy support for DBus properties (Set 1) Signed-off-by: Christian Linke (cherry picked from commit ea96ef59e29466667c90b506426e2a5a9cdb82d2) --- .../Consumer/ConsumerDBusStubAdapter.cpp | 374 +++++++++++++++++++++ 1 file changed, 374 insertions(+) create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp (limited to 'AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp') diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp new file mode 100644 index 0000000..a72ba16 --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp @@ -0,0 +1,374 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2012, BMW AG + * + * This file is part of GENIVI Project AudioManager. + * + * Contributions are licensed to the GENIVI Alliance under one or more + * Contribution License Agreements. + * + * \copyright + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with + * this file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * + * \author Aleksandar Donchev, aleksander.donchev@partner.bmw.de BMW 2013 + * + * For further information see http://www.genivi.org/. +*/ +#include "ConsumerDBusStubAdapter.h" +#include + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +std::shared_ptr createConsumerDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyConnection, + const std::shared_ptr& stubBase) { + return std::make_shared(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection, stubBase); +} + +__attribute__((constructor)) void registerConsumerDBusStubAdapter(void) { + CommonAPI::DBus::DBusFactory::registerAdapterFactoryMethod(Consumer::getInterfaceId(), + &createConsumerDBusStubAdapter); +} + +ConsumerDBusStubAdapter::ConsumerDBusStubAdapter( + const std::string& commonApiAddress, + const std::string& dbusInterfaceName, + const std::string& dbusBusName, + const std::string& dbusObjectPath, + const std::shared_ptr& dbusConnection, + const std::shared_ptr& stub): + ConsumerDBusStubAdapterHelper(commonApiAddress, dbusInterfaceName, dbusBusName, dbusObjectPath, dbusConnection, std::dynamic_pointer_cast(stub)) { +} + +const char* ConsumerDBusStubAdapter::getMethodsDBusIntrospectionXmlData() const { + return + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + "\n" + ; +} + + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getRestartReasonAttributeStubDispatcher(&ConsumerStub::getRestartReasonAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setRestartReasonAttributeStubDispatcher( + &ConsumerStub::getRestartReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteSetRestartReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteRestartReasonAttributeChanged, + &ConsumerStubAdapter::fireRestartReasonAttributeChanged, + "i"); + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getShutdownReasonAttributeStubDispatcher(&ConsumerStub::getShutdownReasonAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setShutdownReasonAttributeStubDispatcher( + &ConsumerStub::getShutdownReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteSetShutdownReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteShutdownReasonAttributeChanged, + &ConsumerStubAdapter::fireShutdownReasonAttributeChanged, + "i"); + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getWakeUpReasonAttributeStubDispatcher(&ConsumerStub::getWakeUpReasonAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setWakeUpReasonAttributeStubDispatcher( + &ConsumerStub::getWakeUpReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteSetWakeUpReasonAttribute, + &ConsumerStubRemoteEvent::onRemoteWakeUpReasonAttributeChanged, + &ConsumerStubAdapter::fireWakeUpReasonAttributeChanged, + "i"); + +static CommonAPI::DBus::DBusGetAttributeStubDispatcher< + ConsumerStub, + int32_t + > getBootModeAttributeStubDispatcher(&ConsumerStub::getBootModeAttribute, "i"); +static CommonAPI::DBus::DBusSetObservableAttributeStubDispatcher< + ConsumerStub, + int32_t + > setBootModeAttributeStubDispatcher( + &ConsumerStub::getBootModeAttribute, + &ConsumerStubRemoteEvent::onRemoteSetBootModeAttribute, + &ConsumerStubRemoteEvent::onRemoteBootModeAttributeChanged, + &ConsumerStubAdapter::fireBootModeAttributeChanged, + "i"); + + +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getNodeStateStubDispatcher(&ConsumerStub::GetNodeState, "ii"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > setSessionStateStubDispatcher(&ConsumerStub::SetSessionState, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > getSessionStateStubDispatcher(&ConsumerStub::GetSessionState, "ii"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getApplicationModeStubDispatcher(&ConsumerStub::GetApplicationMode, "ii"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > registerShutdownClientStubDispatcher(&ConsumerStub::RegisterShutdownClient, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > unRegisterShutdownClientStubDispatcher(&ConsumerStub::UnRegisterShutdownClient, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > registerSessionStubDispatcher(&ConsumerStub::RegisterSession, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > unRegisterSessionStubDispatcher(&ConsumerStub::UnRegisterSession, "i"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getAppHealthCountStubDispatcher(&ConsumerStub::GetAppHealthCount, "u"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple<>, + std::tuple + > getInterfaceVersionStubDispatcher(&ConsumerStub::GetInterfaceVersion, "u"); +static CommonAPI::DBus::DBusMethodWithReplyStubDispatcher< + ConsumerStub, + std::tuple, + std::tuple + > lifecycleRequestCompleteStubDispatcher(&ConsumerStub::LifecycleRequestComplete, "i"); + +void ConsumerDBusStubAdapter::fireRestartReasonAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onRestartReasonAttributeChanged", + "i", + value + ); +} +void ConsumerDBusStubAdapter::fireShutdownReasonAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onShutdownReasonAttributeChanged", + "i", + value + ); +} +void ConsumerDBusStubAdapter::fireWakeUpReasonAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onWakeUpReasonAttributeChanged", + "i", + value + ); +} +void ConsumerDBusStubAdapter::fireBootModeAttributeChanged(const int32_t& value) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "onBootModeAttributeChanged", + "i", + value + ); +} + +void ConsumerDBusStubAdapter::fireNodeStateEvent(const int32_t& NodeState) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NodeState", + "i", + NodeState + ); +} +void ConsumerDBusStubAdapter::fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "NodeApplicationMode", + "i", + ApplicationModeId + ); +} +void ConsumerDBusStubAdapter::fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) { + CommonAPI::DBus::DBusStubSignalHelper> + ::sendSignal( + *this, + "SessionStateChanged", + "sii", + SessionStateName, SeatID, SessionState + ); +} + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +template<> +const org::genivi::NodeStateManager::Consumer::ConsumerDBusStubAdapterHelper::StubDispatcherTable org::genivi::NodeStateManager::Consumer::ConsumerDBusStubAdapterHelper::stubDispatcherTable_ = { + { { "getRestartReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getRestartReasonAttributeStubDispatcher } + , { { "setRestartReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setRestartReasonAttributeStubDispatcher }, + { { "getShutdownReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getShutdownReasonAttributeStubDispatcher } + , { { "setShutdownReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setShutdownReasonAttributeStubDispatcher }, + { { "getWakeUpReasonAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getWakeUpReasonAttributeStubDispatcher } + , { { "setWakeUpReasonAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setWakeUpReasonAttributeStubDispatcher }, + { { "getBootModeAttribute", "" }, &org::genivi::NodeStateManager::Consumer::getBootModeAttributeStubDispatcher } + , { { "setBootModeAttribute", "i" }, &org::genivi::NodeStateManager::Consumer::setBootModeAttributeStubDispatcher } + , + { { "GetNodeState", "" }, &org::genivi::NodeStateManager::Consumer::getNodeStateStubDispatcher }, + { { "SetSessionState", "ssii" }, &org::genivi::NodeStateManager::Consumer::setSessionStateStubDispatcher }, + { { "GetSessionState", "si" }, &org::genivi::NodeStateManager::Consumer::getSessionStateStubDispatcher }, + { { "GetApplicationMode", "" }, &org::genivi::NodeStateManager::Consumer::getApplicationModeStubDispatcher }, + { { "RegisterShutdownClient", "ssuu" }, &org::genivi::NodeStateManager::Consumer::registerShutdownClientStubDispatcher }, + { { "UnRegisterShutdownClient", "ssu" }, &org::genivi::NodeStateManager::Consumer::unRegisterShutdownClientStubDispatcher }, + { { "RegisterSession", "ssii" }, &org::genivi::NodeStateManager::Consumer::registerSessionStubDispatcher }, + { { "UnRegisterSession", "ssi" }, &org::genivi::NodeStateManager::Consumer::unRegisterSessionStubDispatcher }, + { { "GetAppHealthCount", "" }, &org::genivi::NodeStateManager::Consumer::getAppHealthCountStubDispatcher }, + { { "GetInterfaceVersion", "" }, &org::genivi::NodeStateManager::Consumer::getInterfaceVersionStubDispatcher }, + { { "LifecycleRequestComplete", "ui" }, &org::genivi::NodeStateManager::Consumer::lifecycleRequestCompleteStubDispatcher } +}; -- cgit v1.2.1