2 * This file was generated by the CommonAPI Generators.
4 * Copyright (C) 2013, BMW AG
6 * \author Christian Linke, christian.linke@bmw.de BMW 2012,2013
8 #ifndef ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_H_
9 #define ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_H_
16 #define COMMONAPI_INTERNAL_COMPILATION
19 #include <CommonAPI/Stub.h>
21 #undef COMMONAPI_INTERNAL_COMPILATION
25 namespace NodeStateManager {
28 * Receives messages from remote and handles all dispatching of deserialized calls
29 * to a stub for the service Consumer. Also provides means to send broadcasts
30 * and attribute-changed-notifications of observable attributes as defined by this service.
31 * An application developer should not need to bother with this class.
33 class ConsumerStubAdapter: virtual public CommonAPI::StubAdapter, public Consumer {
37 * Sends a broadcast event for NodeApplicationMode. Should not be called directly.
38 * Instead, the "fire<broadcastName>Event" methods of the stub should be used.
40 virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) = 0;
42 * Sends a broadcast event for SessionStateChanged. Should not be called directly.
43 * Instead, the "fire<broadcastName>Event" methods of the stub should be used.
45 virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) = 0;
47 * Sends a broadcast event for NodeState. Should not be called directly.
48 * Instead, the "fire<broadcastName>Event" methods of the stub should be used.
50 virtual void fireNodeStateEvent(const int32_t& NodeState) = 0;
55 * Defines the necessary callbacks to handle remote set events related to the attributes
56 * defined in the IDL description for Consumer.
57 * For each attribute two callbacks are defined:
58 * - a verification callback that allows to verify the requested value and to prevent setting
59 * e.g. an invalid value ("onRemoteSet<AttributeName>").
60 * - an action callback to do local work after the attribute value has been changed
61 * ("onRemote<AttributeName>Changed").
63 * This class and the one below are the ones an application developer needs to have
64 * a look at if he wants to implement a service.
66 class ConsumerStubRemoteEvent {
68 virtual ~ConsumerStubRemoteEvent() { }
70 /// Verification callback for remote set requests on the attribute BootMode.
71 virtual bool onRemoteSetBootModeAttribute(int32_t BootMode) = 0;
72 /// Action callback for remote set requests on the attribute BootMode.
73 virtual void onRemoteBootModeAttributeChanged() = 0;
75 /// Verification callback for remote set requests on the attribute RestartReason.
76 virtual bool onRemoteSetRestartReasonAttribute(int32_t RestartReason) = 0;
77 /// Action callback for remote set requests on the attribute RestartReason.
78 virtual void onRemoteRestartReasonAttributeChanged() = 0;
80 /// Verification callback for remote set requests on the attribute ShutdownReason.
81 virtual bool onRemoteSetShutdownReasonAttribute(int32_t ShutdownReason) = 0;
82 /// Action callback for remote set requests on the attribute ShutdownReason.
83 virtual void onRemoteShutdownReasonAttributeChanged() = 0;
85 /// Verification callback for remote set requests on the attribute WakeUpReason.
86 virtual bool onRemoteSetWakeUpReasonAttribute(int32_t WakeUpReason) = 0;
87 /// Action callback for remote set requests on the attribute WakeUpReason.
88 virtual void onRemoteWakeUpReasonAttributeChanged() = 0;
94 * Defines the interface that must be implemented by any class that should provide
95 * the service Consumer to remote clients.
96 * This class and the one above are the ones an application developer needs to have
97 * a look at if he wants to implement a service.
99 class ConsumerStub : public CommonAPI::Stub<ConsumerStubAdapter , ConsumerStubRemoteEvent> {
101 virtual ~ConsumerStub() { }
103 /// Provides getter access to the attribute BootMode.
104 virtual const int32_t& getBootModeAttribute() = 0;
105 /// Provides getter access to the attribute RestartReason.
106 virtual const int32_t& getRestartReasonAttribute() = 0;
107 /// Provides getter access to the attribute ShutdownReason.
108 virtual const int32_t& getShutdownReasonAttribute() = 0;
109 /// Provides getter access to the attribute WakeUpReason.
110 virtual const int32_t& getWakeUpReasonAttribute() = 0;
112 /// This is the method that will be called on remote calls on the method GetAppHealthCount.
113 virtual void GetAppHealthCount(uint32_t& Count) = 0;
114 /// This is the method that will be called on remote calls on the method LifecycleRequestComplete.
115 virtual void LifecycleRequestComplete(uint32_t RequestId, int32_t Status, int32_t& ErrorCode) = 0;
116 /// This is the method that will be called on remote calls on the method GetInterfaceVersion.
117 virtual void GetInterfaceVersion(uint32_t& Version) = 0;
118 /// This is the method that will be called on remote calls on the method GetApplicationMode.
119 virtual void GetApplicationMode(int32_t& ErrorCode, int32_t& ApplicationModeId) = 0;
120 /// This is the method that will be called on remote calls on the method UnRegisterSession.
121 virtual void UnRegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t& ErrorCode) = 0;
122 /// This is the method that will be called on remote calls on the method RegisterSession.
123 virtual void RegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode) = 0;
124 /// This is the method that will be called on remote calls on the method UnRegisterShutdownClient.
125 virtual void UnRegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, int32_t& ErrorCode) = 0;
126 /// This is the method that will be called on remote calls on the method RegisterShutdownClient.
127 virtual void RegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, uint32_t TimeoutMs, int32_t& ErrorCode) = 0;
128 /// This is the method that will be called on remote calls on the method GetNodeState.
129 virtual void GetNodeState(int32_t& ErrorCode, int32_t& NodeStateId) = 0;
130 /// This is the method that will be called on remote calls on the method GetSessionState.
131 virtual void GetSessionState(std::string SessionName, int32_t SeatID, int32_t& SessionState, int32_t& ErrorCode) = 0;
132 /// This is the method that will be called on remote calls on the method SetSessionState.
133 virtual void SetSessionState(std::string SessionName, std::string SessionOwner, int32_t SessionState, int32_t SeatID, int32_t& ErrorCode) = 0;
135 /// Sends a broadcast event for NodeApplicationMode.
136 virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) = 0;
137 /// Sends a broadcast event for SessionStateChanged.
138 virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) = 0;
139 /// Sends a broadcast event for NodeState.
140 virtual void fireNodeStateEvent(const int32_t& NodeState) = 0;
143 } // namespace NodeStateManager
144 } // namespace genivi
147 #endif // ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_H_