1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/*
* 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_STUB_DEFAULT_H_
#define ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_DEFAULT_H_
#include <org/genivi/NodeStateManager/ConsumerStub.h>
namespace org {
namespace genivi {
namespace NodeStateManager {
/**
* Provides a default implementation for ConsumerStubRemoteEvent and
* ConsumerStub. Method callbacks have an empty implementation,
* remote set calls on attributes will always change the value of the attribute
* to the one received.
*
* Override this stub if you only want to provide a subset of the functionality
* that would be defined for this service, and/or if you do not need any non-default
* behaviour.
*/
class ConsumerStubDefault : public ConsumerStub {
public:
ConsumerStubDefault();
ConsumerStubRemoteEvent* initStubAdapter(const std::shared_ptr<ConsumerStubAdapter>& stubAdapter);
virtual const int32_t& getBootModeAttribute();
virtual void setBootModeAttribute(int32_t value);
virtual const int32_t& getRestartReasonAttribute();
virtual void setRestartReasonAttribute(int32_t value);
virtual const int32_t& getShutdownReasonAttribute();
virtual void setShutdownReasonAttribute(int32_t value);
virtual const int32_t& getWakeUpReasonAttribute();
virtual void setWakeUpReasonAttribute(int32_t value);
virtual void GetAppHealthCount(uint32_t& Count);
virtual void LifecycleRequestComplete(uint32_t RequestId, int32_t Status, int32_t& ErrorCode);
virtual void GetInterfaceVersion(uint32_t& Version);
virtual void GetApplicationMode(int32_t& ErrorCode, int32_t& ApplicationModeId);
virtual void UnRegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t& ErrorCode);
virtual void RegisterSession(std::string SessionName, std::string SessionOwner, int32_t SeatID, int32_t SessionState, int32_t& ErrorCode);
virtual void UnRegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, int32_t& ErrorCode);
virtual void RegisterShutdownClient(std::string BusName, std::string ObjName, uint32_t ShutdownMode, uint32_t TimeoutMs, int32_t& ErrorCode);
virtual void GetNodeState(int32_t& ErrorCode, int32_t& NodeStateId);
virtual void GetSessionState(std::string SessionName, int32_t SeatID, int32_t& SessionState, int32_t& ErrorCode);
virtual void SetSessionState(std::string SessionName, std::string SessionOwner, int32_t SessionState, int32_t SeatID, int32_t& ErrorCode);
virtual void fireNodeApplicationModeEvent(const int32_t& ApplicationModeId);
virtual void fireSessionStateChangedEvent(const std::string& SessionStateName, const int32_t& SeatID, const int32_t& SessionState);
virtual void fireNodeStateEvent(const int32_t& NodeState);
protected:
virtual void onRemoteBootModeAttributeChanged();
virtual bool trySetBootModeAttribute(int32_t value);
virtual bool validateBootModeAttributeRequestedValue(const int32_t& value);
virtual void onRemoteRestartReasonAttributeChanged();
virtual bool trySetRestartReasonAttribute(int32_t value);
virtual bool validateRestartReasonAttributeRequestedValue(const int32_t& value);
virtual void onRemoteShutdownReasonAttributeChanged();
virtual bool trySetShutdownReasonAttribute(int32_t value);
virtual bool validateShutdownReasonAttributeRequestedValue(const int32_t& value);
virtual void onRemoteWakeUpReasonAttributeChanged();
virtual bool trySetWakeUpReasonAttribute(int32_t value);
virtual bool validateWakeUpReasonAttributeRequestedValue(const int32_t& value);
private:
class RemoteEventHandler: public ConsumerStubRemoteEvent {
public:
RemoteEventHandler(ConsumerStubDefault* defaultStub);
virtual bool onRemoteSetBootModeAttribute(int32_t value);
virtual void onRemoteBootModeAttributeChanged();
virtual bool onRemoteSetRestartReasonAttribute(int32_t value);
virtual void onRemoteRestartReasonAttributeChanged();
virtual bool onRemoteSetShutdownReasonAttribute(int32_t value);
virtual void onRemoteShutdownReasonAttributeChanged();
virtual bool onRemoteSetWakeUpReasonAttribute(int32_t value);
virtual void onRemoteWakeUpReasonAttributeChanged();
private:
ConsumerStubDefault* defaultStub_;
};
RemoteEventHandler remoteEventHandler_;
std::shared_ptr<ConsumerStubAdapter> stubAdapter_;
int32_t bootModeAttributeValue_;
int32_t restartReasonAttributeValue_;
int32_t shutdownReasonAttributeValue_;
int32_t wakeUpReasonAttributeValue_;
};
} // namespace NodeStateManager
} // namespace genivi
} // namespace org
#endif // ORG_GENIVI_NODESTATEMANAGER_Consumer_STUB_DEFAULT_H_
|