From db8583483517265e9d6b0fdb3add2cad2cdbcca9 Mon Sep 17 00:00:00 2001 From: Christian Linke Date: Mon, 9 Sep 2013 18:40:19 +0200 Subject: * some naming adoptions & review for GENIVI Signed-off-by: Christian Linke --- src-gen/org/genivi/NodeStateManager/Consumer.h | 55 ++ .../genivi/NodeStateManager/ConsumerDBusProxy.cpp | 277 ++++++++++ .../genivi/NodeStateManager/ConsumerDBusProxy.h | 99 ++++ .../org/genivi/NodeStateManager/ConsumerProxy.h | 604 +++++++++++++++++++++ .../genivi/NodeStateManager/ConsumerProxyBase.h | 99 ++++ src-gen/org/genivi/NodeStateManager/ConsumerStub.h | 147 +++++ .../NodeStateManager/ConsumerStubDefault.cpp | 217 ++++++++ .../genivi/NodeStateManager/ConsumerStubDefault.h | 126 +++++ .../genivi/NodeStateManager/LifeCycleConsumer.h | 55 ++ .../LifeCycleConsumerDBusProxy.cpp | 67 +++ .../NodeStateManager/LifeCycleConsumerDBusProxy.h | 53 ++ .../LifeCycleConsumerDBusStubAdapter.cpp | 67 +++ .../LifeCycleConsumerDBusStubAdapter.h | 46 ++ .../NodeStateManager/LifeCycleConsumerProxy.h | 151 ++++++ .../NodeStateManager/LifeCycleConsumerProxyBase.h | 43 ++ .../NodeStateManager/LifeCycleConsumerStub.h | 78 +++ .../LifeCycleConsumerStubDefault.cpp | 36 ++ .../LifeCycleConsumerStubDefault.h | 59 ++ 18 files changed, 2279 insertions(+) create mode 100644 src-gen/org/genivi/NodeStateManager/Consumer.h create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.cpp create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.h create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerProxy.h create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerProxyBase.h create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerStub.h create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerStubDefault.cpp create mode 100644 src-gen/org/genivi/NodeStateManager/ConsumerStubDefault.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumer.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerDBusProxy.cpp create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerDBusProxy.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerDBusStubAdapter.cpp create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerDBusStubAdapter.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerProxy.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerProxyBase.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerStub.h create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerStubDefault.cpp create mode 100644 src-gen/org/genivi/NodeStateManager/LifeCycleConsumerStubDefault.h (limited to 'src-gen/org/genivi') diff --git a/src-gen/org/genivi/NodeStateManager/Consumer.h b/src-gen/org/genivi/NodeStateManager/Consumer.h new file mode 100644 index 0000000..026f431 --- /dev/null +++ b/src-gen/org/genivi/NodeStateManager/Consumer.h @@ -0,0 +1,55 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2013, BMW AG + * + * \author Christian Linke, christian.linke@bmw.de BMW 2012,2013 +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_Consumer_H_ +#define ORG_GENIVI_NODESTATEMANAGER_Consumer_H_ + + + +#define COMMONAPI_INTERNAL_COMPILATION + +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { + +class Consumer { + public: + virtual ~Consumer() { } + + static inline const char* getInterfaceId(); + static inline CommonAPI::Version getInterfaceVersion(); +}; + +const char* Consumer::getInterfaceId() { + return "org.genivi.NodeStateManager.Consumer"; +} + +CommonAPI::Version Consumer::getInterfaceVersion() { + return CommonAPI::Version(1, 0); +} + + +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +namespace CommonAPI { + +} + + +namespace std { + //hashes for types + + //hashes for error types +} + +#endif // ORG_GENIVI_NODESTATEMANAGER_Consumer_H_ diff --git a/src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.cpp b/src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.cpp new file mode 100644 index 0000000..202680d --- /dev/null +++ b/src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.cpp @@ -0,0 +1,277 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2013, BMW AG + * + * \author Christian Linke, christian.linke@bmw.de BMW 2012,2013 +*/ +#include "ConsumerDBusProxy.h" + +namespace org { +namespace genivi { +namespace NodeStateManager { + +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) +, bootMode_(*this, interfaceName.c_str(), "BootMode"), + restartReason_(*this, interfaceName.c_str(), "RestartReason"), + shutdownReason_(*this, interfaceName.c_str(), "ShutdownReason"), + wakeUpReason_(*this, interfaceName.c_str(), "WakeUpReason") +, nodeApplicationMode_(*this, "NodeApplicationMode", "i"), + sessionStateChanged_(*this, "SessionStateChanged", "sii"), + nodeState_(*this, "NodeState", "i") + { +} + +ConsumerDBusProxy::BootModeAttribute& ConsumerDBusProxy::getBootModeAttribute() { + return bootMode_; +} +ConsumerDBusProxy::RestartReasonAttribute& ConsumerDBusProxy::getRestartReasonAttribute() { + return restartReason_; +} +ConsumerDBusProxy::ShutdownReasonAttribute& ConsumerDBusProxy::getShutdownReasonAttribute() { + return shutdownReason_; +} +ConsumerDBusProxy::WakeUpReasonAttribute& ConsumerDBusProxy::getWakeUpReasonAttribute() { + return wakeUpReason_; +} + +ConsumerDBusProxy::NodeApplicationModeEvent& ConsumerDBusProxy::getNodeApplicationModeEvent() { + return nodeApplicationMode_; +} +ConsumerDBusProxy::SessionStateChangedEvent& ConsumerDBusProxy::getSessionStateChangedEvent() { + return sessionStateChanged_; +} +ConsumerDBusProxy::NodeStateEvent& ConsumerDBusProxy::getNodeStateEvent() { + return nodeState_; +} + +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::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::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::GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ErrorCode, int32_t& ApplicationModeId) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetApplicationMode", + "", + callStatus + , ErrorCode, ApplicationModeId); +} +std::future ConsumerDBusProxy::GetApplicationModeAsync(GetApplicationModeAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetApplicationMode", + "", + 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::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::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::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::GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& ErrorCode, int32_t& NodeStateId) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "GetNodeState", + "", + callStatus + , ErrorCode, NodeStateId); +} +std::future ConsumerDBusProxy::GetNodeStateAsync(GetNodeStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "GetNodeState", + "", + 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::SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SessionState, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode) { + CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodWithReply( + *this, + "SetSessionState", + "ssii", + SessionName, SessionOwner, SessionState, SeatID, + callStatus + , ErrorCode); +} +std::future ConsumerDBusProxy::SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SessionState, const int32_t& SeatID, SetSessionStateAsyncCallback callback) { + return CommonAPI::DBus::DBusProxyHelper, + CommonAPI::DBus::DBusSerializableArguments >::callMethodAsync( + *this, + "SetSessionState", + "ssii", + SessionName, SessionOwner, SessionState, SeatID, + std::move(callback)); +} + +void ConsumerDBusProxy::getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const { + ownVersionMajor = 1; + ownVersionMinor = 0; +} + +} // namespace NodeStateManager +} // namespace genivi +} // namespace org diff --git a/src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.h b/src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.h new file mode 100644 index 0000000..fe17687 --- /dev/null +++ b/src-gen/org/genivi/NodeStateManager/ConsumerDBusProxy.h @@ -0,0 +1,99 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2013, BMW AG + * + * \author Christian Linke, christian.linke@bmw.de BMW 2012,2013 +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_Consumer_DBUS_PROXY_H_ +#define ORG_GENIVI_NODESTATEMANAGER_Consumer_DBUS_PROXY_H_ + +#include + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +#include + +namespace org { +namespace genivi { +namespace NodeStateManager { + +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 BootModeAttribute& getBootModeAttribute(); + virtual RestartReasonAttribute& getRestartReasonAttribute(); + virtual ShutdownReasonAttribute& getShutdownReasonAttribute(); + virtual WakeUpReasonAttribute& getWakeUpReasonAttribute(); + + virtual NodeApplicationModeEvent& getNodeApplicationModeEvent(); + virtual SessionStateChangedEvent& getSessionStateChangedEvent(); + virtual NodeStateEvent& getNodeStateEvent(); + + + virtual void GetAppHealthCount(CommonAPI::CallStatus& callStatus, uint32_t& Count); + virtual std::future GetAppHealthCountAsync(GetAppHealthCountAsyncCallback 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 GetInterfaceVersion(CommonAPI::CallStatus& callStatus, uint32_t& Version); + virtual std::future GetInterfaceVersionAsync(GetInterfaceVersionAsyncCallback callback); + + virtual void GetApplicationMode(CommonAPI::CallStatus& callStatus, int32_t& ErrorCode, int32_t& ApplicationModeId); + virtual std::future GetApplicationModeAsync(GetApplicationModeAsyncCallback 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 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 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 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 GetNodeState(CommonAPI::CallStatus& callStatus, int32_t& ErrorCode, int32_t& NodeStateId); + virtual std::future GetNodeStateAsync(GetNodeStateAsyncCallback 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 SetSessionState(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SessionState, const int32_t& SeatID, CommonAPI::CallStatus& callStatus, int32_t& ErrorCode); + virtual std::future SetSessionStateAsync(const std::string& SessionName, const std::string& SessionOwner, const int32_t& SessionState, const int32_t& SeatID, SetSessionStateAsyncCallback callback); + + virtual void getOwnVersion(uint16_t& ownVersionMajor, uint16_t& ownVersionMinor) const; + + private: + CommonAPI::DBus::DBusFreedesktopReadonlyAttribute bootMode_; + CommonAPI::DBus::DBusFreedesktopReadonlyAttribute restartReason_; + CommonAPI::DBus::DBusFreedesktopReadonlyAttribute shutdownReason_; + CommonAPI::DBus::DBusFreedesktopReadonlyAttribute wakeUpReason_; + + CommonAPI::DBus::DBusEvent nodeApplicationMode_; + CommonAPI::DBus::DBusEvent sessionStateChanged_; + CommonAPI::DBus::DBusEvent nodeState_; +}; + +} // namespace NodeStateManager +} // namespace genivi +} // namespace org + +#endif // ORG_GENIVI_NODESTATEMANAGER_Consumer_DBUS_PROXY_H_ diff --git a/src-gen/org/genivi/NodeStateManager/ConsumerProxy.h b/src-gen/org/genivi/NodeStateManager/ConsumerProxy.h new file mode 100644 index 0000000..e0aab4d --- /dev/null +++ b/src-gen/org/genivi/NodeStateManager/ConsumerProxy.h @@ -0,0 +1,604 @@ +/* +* This file was generated by the CommonAPI Generators. +* + * Copyright (C) 2013, BMW AG + * + * \author Christian Linke, christian.linke@bmw.de BMW 2012,2013 +*/ +#ifndef ORG_GENIVI_NODESTATEMANAGER_Consumer_PROXY_H_ +#define ORG_GENIVI_NODESTATEMANAGER_Consumer_PROXY_H_ + +#include "ConsumerProxyBase.h" + +#define COMMONAPI_INTERNAL_COMPILATION + +#include +#include + +#undef COMMONAPI_INTERNAL_COMPILATION + +namespace org { +namespace genivi { +namespace NodeStateManager { + +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 BootMode. + virtual BootModeAttribute& getBootModeAttribute() { + return delegate_->getBootModeAttribute(); + } + + /// 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 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(); + } + + /// Returns the wrapper class that provides access to the broadcast NodeState. + virtual NodeStateEvent& getNodeStateEvent() { + return delegate_->getNodeStateEvent(); + } + + + + /** + * 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 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); + + /** + * 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 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& ErrorCode, int32_t& ApplicationModeId); + /** + * 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 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 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 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 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 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& ErrorCode, int32_t& NodeStateId); + /** + * 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 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 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& SessionState, const int32_t& SeatID, 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& SessionState, const int32_t& SeatID, SetSessionStateAsyncCallback 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