4d4aebbc3abe9ea007cb65270f0270f4dcdd7423
[profile/ivi/genivi/genivi-audio-manager.git] / src-gen / org / genivi / NodeStateManager / ConsumerStub.h
1 /*
2 * This file was generated by the CommonAPI Generators.
3 *
4  * Copyright (C) 2013, BMW AG
5  *
6  * \author Christian Linke, christian.linke@bmw.de BMW 2012,2013
7 */
8 #ifndef ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_H_
9 #define ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_H_
10
11
12
13
14 #include "Consumer.h"
15
16 #define COMMONAPI_INTERNAL_COMPILATION
17
18
19 #include <CommonAPI/Stub.h>
20
21 #undef COMMONAPI_INTERNAL_COMPILATION
22
23 namespace org {
24 namespace genivi {
25 namespace NodeStateManager {
26
27 /**
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.
32  */
33 class ConsumerStubAdapter: virtual public CommonAPI::StubAdapter, public Consumer {
34  public:
35
36     /**
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.
39      */
40     virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId) = 0;
41     /**
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.
44      */
45     virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState) = 0;
46     /**
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.
49      */
50     virtual void fireNodeStateEvent(const int32_t& NodeState) = 0;
51 };
52
53
54 /**
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").
62  *
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.
65  */
66 class ConsumerStubRemoteEvent {
67  public:
68     virtual ~ConsumerStubRemoteEvent() { }
69
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;
74
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;
79
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;
84
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;
89
90 };
91
92
93 /**
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.
98  */
99 class ConsumerStub : public CommonAPI::Stub<ConsumerStubAdapter , ConsumerStubRemoteEvent> {
100  public:
101     virtual ~ConsumerStub() { }
102
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;
111
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;
134     
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;
141 };
142
143 } // namespace NodeStateManager
144 } // namespace genivi
145 } // namespace org
146
147 #endif // ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_H_