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) --- .../genivi/NodeStateManager/Consumer/Consumer.h | 70 +++ .../Consumer/ConsumerDBusProxy.cpp | 292 ++++++++++ .../NodeStateManager/Consumer/ConsumerDBusProxy.h | 114 ++++ .../Consumer/ConsumerDBusStubAdapter.cpp | 374 +++++++++++++ .../Consumer/ConsumerDBusStubAdapter.h | 68 +++ .../NodeStateManager/Consumer/ConsumerProxy.h | 619 +++++++++++++++++++++ .../NodeStateManager/Consumer/ConsumerProxyBase.h | 114 ++++ .../NodeStateManager/Consumer/ConsumerStub.h | 170 ++++++ .../Consumer/ConsumerStubDefault.cpp | 240 ++++++++ .../Consumer/ConsumerStubDefault.h | 141 +++++ .../LifeCycleConsumer/LifeCycleConsumer.h | 70 +++ .../LifeCycleConsumerDBusProxy.cpp | 82 +++ .../LifeCycleConsumer/LifeCycleConsumerDBusProxy.h | 68 +++ .../LifeCycleConsumerDBusStubAdapter.cpp | 82 +++ .../LifeCycleConsumerDBusStubAdapter.h | 61 ++ .../LifeCycleConsumer/LifeCycleConsumerProxy.h | 166 ++++++ .../LifeCycleConsumer/LifeCycleConsumerProxyBase.h | 58 ++ .../LifeCycleConsumer/LifeCycleConsumerStub.h | 93 ++++ .../LifeCycleConsumerStubDefault.cpp | 51 ++ .../LifeCycleConsumerStubDefault.h | 74 +++ 20 files changed, 3007 insertions(+) create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxyBase.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStub.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerStubDefault.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumer.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerDBusStubAdapter.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxy.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerProxyBase.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStub.h create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.cpp create mode 100644 AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/LifeCycleConsumer/LifeCycleConsumerStubDefault.h (limited to 'AudioManagerDaemon/src-gen') diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h new file mode 100644 index 0000000..345bd3b --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/Consumer.h @@ -0,0 +1,70 @@ +/* +* 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/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_ + + + +#define COMMONAPI_INTERNAL_COMPILATION + +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +class Consumer { + public: + virtual ~Consumer() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* Consumer::getInterfaceId() { + return "org.genivi.NodeStateManager.Consumer.Consumer"; +} + +CommonAPI::Version Consumer::getInterfaceVersion() { + return CommonAPI::Version(0, 1); +} + + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +namespace CommonAPI { + +} + + +namespace std { + //hashes for types + + //hashes for error types +} + +#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_H_ diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp new file mode 100644 index 0000000..e920d51 --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.cpp @@ -0,0 +1,292 @@ +/* +* 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 "ConsumerDBusProxy.h" + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +std::shared_ptr createConsumerDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyConnection) { + return std::make_shared(commonApiAddress, interfaceName, busName, objectPath, dbusProxyConnection); +} + +__attribute__((constructor)) void registerConsumerDBusProxy(void) { + CommonAPI::DBus::DBusFactory::registerProxyFactoryMethod(Consumer::getInterfaceId(), + &createConsumerDBusProxy); +} + +ConsumerDBusProxy::ConsumerDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyconnection): + CommonAPI::DBus::DBusProxy(commonApiAddress, interfaceName, busName, objectPath, dbusProxyconnection) +, restartReason_(*this, interfaceName.c_str(), "RestartReason"), + shutdownReason_(*this, interfaceName.c_str(), "ShutdownReason"), + wakeUpReason_(*this, interfaceName.c_str(), "WakeUpReason"), + bootMode_(*this, interfaceName.c_str(), "BootMode") +, nodeState_(*this, "NodeState", "i"), + nodeApplicationMode_(*this, "NodeApplicationMode", "i"), + sessionStateChanged_(*this, "SessionStateChanged", "sii") + { +} + +ConsumerDBusProxy::RestartReasonAttribute& ConsumerDBusProxy::getRestartReasonAttribute() { + return restartReason_; +} +ConsumerDBusProxy::ShutdownReasonAttribute& ConsumerDBusProxy::getShutdownReasonAttribute() { + return shutdownReason_; +} +ConsumerDBusProxy::WakeUpReasonAttribute& ConsumerDBusProxy::getWakeUpReasonAttribute() { + return wakeUpReason_; +} +ConsumerDBusProxy::BootModeAttribute& ConsumerDBusProxy::getBootModeAttribute() { + return bootMode_; +} + +ConsumerDBusProxy::NodeStateEvent& ConsumerDBusProxy::getNodeStateEvent() { + return nodeState_; +} +ConsumerDBusProxy::NodeApplicationModeEvent& ConsumerDBusProxy::getNodeApplicationModeEvent() { + return nodeApplicationMode_; +} +ConsumerDBusProxy::SessionStateChangedEvent& ConsumerDBusProxy::getSessionStateChangedEvent() { + return sessionStateChanged_; +} + +void ConsumerDBusProxy::GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetNodeState", + "", + callStatus + , NodeStateId, ErrorCode); +} +std::future ConsumerDBusProxy::GetNodeStateAsync(GetNodeStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetNodeState", + "", + std::move(callback)); +} +void ConsumerDBusProxy::SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetSessionState", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetSessionState", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + std::move(callback)); +} +void ConsumerDBusProxy::GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetSessionState", + "si", + SessionName, SeatID, + callStatus + , SessionState, ErrorCode); +} +std::future ConsumerDBusProxy::GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetSessionState", + "si", + SessionName, SeatID, + std::move(callback)); +} +void ConsumerDBusProxy::GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetApplicationMode", + "", + callStatus + , ApplicationModeId, ErrorCode); +} +std::future ConsumerDBusProxy::GetApplicationModeAsync(GetApplicationModeAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetApplicationMode", + "", + std::move(callback)); +} +void ConsumerDBusProxy::RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "RegisterShutdownClient", + "ssuu", + BusName, ObjName, ShutdownMode, TimeoutMs, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "RegisterShutdownClient", + "ssuu", + BusName, ObjName, ShutdownMode, TimeoutMs, + std::move(callback)); +} +void ConsumerDBusProxy::UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "UnRegisterShutdownClient", + "ssu", + BusName, ObjName, ShutdownMode, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "UnRegisterShutdownClient", + "ssu", + BusName, ObjName, ShutdownMode, + std::move(callback)); +} +void ConsumerDBusProxy::RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "RegisterSession", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "RegisterSession", + "ssii", + SessionName, SessionOwner, SeatID, SessionState, + std::move(callback)); +} +void ConsumerDBusProxy::UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "UnRegisterSession", + "ssi", + SessionName, SessionOwner, SeatID, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "UnRegisterSession", + "ssi", + SessionName, SessionOwner, SeatID, + std::move(callback)); +} +void ConsumerDBusProxy::GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetAppHealthCount", + "", + callStatus + , Count); +} +std::future ConsumerDBusProxy::GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetAppHealthCount", + "", + std::move(callback)); +} +void ConsumerDBusProxy::GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetInterfaceVersion", + "", + callStatus + , Version); +} +std::future ConsumerDBusProxy::GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetInterfaceVersion", + "", + std::move(callback)); +} +void ConsumerDBusProxy::LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "LifecycleRequestComplete", + "ui", + RequestId, Status, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "LifecycleRequestComplete", + "ui", + RequestId, Status, + std::move(callback)); +} + +void ConsumerDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 0; + ownVersionMinor = 1; +} + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h new file mode 100644 index 0000000..c3db1df --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusProxy.h @@ -0,0 +1,114 @@ +/* +* 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/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +class ConsumerDBusProxy: virtual public ConsumerProxyBase, virtual public CommonAPI::DBus::DBusProxy { + public: + ConsumerDBusProxy( + const std::string& commonApiAddress, + const std::string& interfaceName, + const std::string& busName, + const std::string& objectPath, + const std::shared_ptr& dbusProxyconnection); + + virtual ~ConsumerDBusProxy() { } + + virtual RestartReasonAttribute& getRestartReasonAttribute(); + virtual ShutdownReasonAttribute& getShutdownReasonAttribute(); + virtual WakeUpReasonAttribute& getWakeUpReasonAttribute(); + virtual BootModeAttribute& getBootModeAttribute(); + + virtual NodeStateEvent& getNodeStateEvent(); + virtual NodeApplicationModeEvent& getNodeApplicationModeEvent(); + virtual SessionStateChangedEvent& getSessionStateChangedEvent(); + + + virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode); + virtual std::future GetNodeStateAsync(GetNodeStateAsyncCallback callback); + + virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback); + + virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode); + virtual std::future GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback); + + virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode); + virtual std::future GetApplicationModeAsync(GetApplicationModeAsyncCallback callback); + + virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback); + + virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback); + + virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback); + + virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback); + + virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count); + virtual std::future GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback); + + virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version); + virtual std::future GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback); + + virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback); + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + CommonAPI::DBus::DBusFreedesktopObservableAttribute> restartReason_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute> shutdownReason_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute> wakeUpReason_; + CommonAPI::DBus::DBusFreedesktopObservableAttribute> bootMode_; + + CommonAPI::DBus::DBusEvent nodeState_; + CommonAPI::DBus::DBusEvent nodeApplicationMode_; + CommonAPI::DBus::DBusEvent sessionStateChanged_; +}; + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_PROXY_H_ 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 } +}; diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h new file mode 100644 index 0000000..8b43c21 --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerDBusStubAdapter.h @@ -0,0 +1,68 @@ +/* +* 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/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +typedef CommonAPI::DBus::DBusStubAdapterHelper ConsumerDBusStubAdapterHelper; + +class ConsumerDBusStubAdapter: public ConsumerStubAdapter, public ConsumerDBusStubAdapterHelper { + public: + 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); + + void fireRestartReasonAttributeChanged(const int32_t& value); + void fireShutdownReasonAttributeChanged(const int32_t& value); + void fireWakeUpReasonAttributeChanged(const int32_t& value); + void fireBootModeAttributeChanged(const int32_t& value); + + void fireNodeStateEvent(const int32_t& NodeState); + void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId); + void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState); + + protected: + virtual const char* getMethodsDBusIntrospectionXmlData() const; +}; + +} // namespace Consumer +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_DBUS_STUB_ADAPTER_H_ diff --git a/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h new file mode 100644 index 0000000..273fa8b --- /dev/null +++ b/AudioManagerDaemon/src-gen/org/genivi/NodeStateManager/Consumer/ConsumerProxy.h @@ -0,0 +1,619 @@ +/* +* 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/. +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_ +#define ORG_GENIVI_NODESTATEMANAGER_CONSUMER_Consumer_PROXY_H_ + +#include "ConsumerProxyBase.h" + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { +namespace Consumer { + +template +class ConsumerProxy: virtual public Consumer, virtual public ConsumerProxyBase, public _AttributeExtensions... { + public: + ConsumerProxy(std::shared_ptr delegate); + ~ConsumerProxy(); + + /// Returns the wrapper class that provides access to the attribute RestartReason. + virtual RestartReasonAttribute& getRestartReasonAttribute() { + return delegate_->getRestartReasonAttribute(); + } + + /// Returns the wrapper class that provides access to the attribute ShutdownReason. + virtual ShutdownReasonAttribute& getShutdownReasonAttribute() { + return delegate_->getShutdownReasonAttribute(); + } + + /// Returns the wrapper class that provides access to the attribute WakeUpReason. + virtual WakeUpReasonAttribute& getWakeUpReasonAttribute() { + return delegate_->getWakeUpReasonAttribute(); + } + + /// Returns the wrapper class that provides access to the attribute BootMode. + virtual BootModeAttribute& getBootModeAttribute() { + return delegate_->getBootModeAttribute(); + } + + + /// Returns the wrapper class that provides access to the broadcast NodeState. + virtual NodeStateEvent& getNodeStateEvent() { + return delegate_->getNodeStateEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast NodeApplicationMode. + virtual NodeApplicationModeEvent& getNodeApplicationModeEvent() { + return delegate_->getNodeApplicationModeEvent(); + } + + /// Returns the wrapper class that provides access to the broadcast SessionStateChanged. + virtual SessionStateChangedEvent& getSessionStateChangedEvent() { + return delegate_->getSessionStateChangedEvent(); + } + + + + /** + * Calls GetNodeState with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& NodeStateId, int32_t& ErrorCode); + /** + * Calls GetNodeState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetNodeStateAsync(GetNodeStateAsyncCallback callback); + + /** + * Calls SetSessionState with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls SetSessionState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, SetSessionStateAsyncCallback callback); + + /** + * Calls GetSessionState with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetSessionState(const std::string& SessionName, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& SessionState, int32_t& ErrorCode); + /** + * Calls GetSessionState with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetSessionStateAsync(const std::string& SessionName, const int32_t& SeatID, GetSessionStateAsyncCallback callback); + + /** + * Calls GetApplicationMode with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ApplicationModeId, int32_t& ErrorCode); + /** + * Calls GetApplicationMode with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetApplicationModeAsync(GetApplicationModeAsyncCallback callback); + + /** + * Calls RegisterShutdownClient with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void RegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls RegisterShutdownClient with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future RegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, const uint32_t& TimeoutMs, RegisterShutdownClientAsyncCallback callback); + + /** + * Calls UnRegisterShutdownClient with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void UnRegisterShutdownClient(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls UnRegisterShutdownClient with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future UnRegisterShutdownClientAsync(const std::string& BusName, const std::string& ObjName, const uint32_t& ShutdownMode, UnRegisterShutdownClientAsyncCallback callback); + + /** + * Calls RegisterSession with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void RegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls RegisterSession with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future RegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, const int32_t& SessionState, RegisterSessionAsyncCallback callback); + + /** + * Calls UnRegisterSession with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void UnRegisterSession(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls UnRegisterSession with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future UnRegisterSessionAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SeatID, UnRegisterSessionAsyncCallback callback); + + /** + * Calls GetAppHealthCount with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count); + /** + * Calls GetAppHealthCount with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetAppHealthCountAsync(GetAppHealthCountAsyncCallback callback); + + /** + * Calls GetInterfaceVersion with synchronous semantics. + * + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version); + /** + * Calls GetInterfaceVersion with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback); + + /** + * Calls LifecycleRequestComplete with synchronous semantics. + * + * All const parameters are input parameters to this method. + * All non-const parameters will be filled with the returned values. + * The CallStatus will be filled when the method returns and indicate either + * "SUCCESS" or which type of error has occurred. In case of an error, ONLY the CallStatus + * will be set. + * Synchronous calls are not supported (will block indefinitely) when mainloop integration is used. + */ + virtual void LifecycleRequestComplete(const uint32_t& RequestId, const int32_t& Status, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + /** + * Calls LifecycleRequestComplete with asynchronous semantics. + * + * The provided callback will be called when the reply to this call arrives or + * an error occurs during the call. The CallStatus will indicate either "SUCCESS" + * or which type of error has occurred. In case of any error, ONLY the CallStatus + * will have a defined value. + * The std::future returned by this method will be fulfilled at arrival of the reply. + * It will provide the same value for CallStatus as will be handed to the callback. + */ + virtual std::future LifecycleRequestCompleteAsync(const uint32_t& RequestId, const int32_t& Status, LifecycleRequestCompleteAsyncCallback callback); + + /// Returns the CommonAPI address of the remote partner this proxy communicates with. + virtual std::string getAddress() const; + + /// Returns the domain of the remote partner this proxy communicates with. + virtual const std::string& getDomain() const; + + /// Returns the service ID of the remote partner this proxy communicates with. + virtual const std::string& getServiceId() const; + + /// Returns the instance ID of the remote partner this proxy communicates with. + virtual const std::string& getInstanceId() const; + + /// Returns true if the remote partner for this proxy is available. + virtual bool isAvailable() const; + + /** + * Returns the wrapper class that is used to (de-)register for notifications about + * the availability of the remote partner of this proxy. + */ + virtual CommonAPI::ProxyStatusEvent& getProxyStatusEvent(); + + /** + * Returns the wrapper class that is used to access version information of the remote + * partner of this proxy. + */ + virtual CommonAPI::InterfaceVersionAttribute& getInterfaceVersionAttribute(); + + private: + std::shared_ptr delegate_; +}; + +namespace ConsumerExtensions { + template