GoPxL SDK

- Home
- Files
- Namespace

GoResponse.h
Go to the documentation of this file.
1
9 #ifndef GO_PXL_SDK_GORESPONSE_H
10 #define GO_PXL_SDK_GORESPONSE_H
11
12 #include <kApi/kApiDef.h>
13
14 #include <GoPxLSdk/Def.h>
15 #include <GoPxLSdk/GoJson.h>
16 #include <GoPxLSdk/GoResponseType.h>
17 #include <GoPxLSdk/GoNotificationType.h>
18
19 class GoStreamResponseTests;
20
21 namespace GoPxLSdk
22 {
23
24 class GoPxLSdkClass GoResponse
25 {
26 public:
30 GoResponse() = default;
31
32 virtual ~GoResponse() = default;
33
42 GoResponse(GoResponseType type, const GoJson& fullmsg);
43
51 virtual kStatus Status() const;
52
60 virtual GoResponseType Type() const;
61
69 virtual const std::string& Path() const;
70
78 virtual const GoJson& Payload() const;
79
87 virtual const GoJson& Raw() const;
88
89 private:
90 kStatus status = kOK;
91 GoResponseType type = GoResponseType::Request;
92 std::string path;
93 GoJson payload;
94 GoJson raw;
95 };
96
97
101 class GoPxLSdkClass GoRequestResponse final : public GoResponse
102 {
103 public:
110 GoRequestResponse() = default;
111 ~GoRequestResponse() = default;
112
120 GoRequestResponse(const GoJson& fullmsg);
121 };
122
123
127 class GoPxLSdkClass GoNotificationResponse final : public GoResponse
128 {
129 public:
136 GoNotificationResponse() = default;
137 ~GoNotificationResponse() = default;
138
146 GoNotificationResponse(const GoJson& fullmsg);
147
156 GoNotificationType NotificationType() const;
157 };
158
159
163 class GoPxLSdkClass GoStreamResponse final : public GoResponse
164 {
165 friend class ::GoStreamResponseTests;
166
167 // Public declaration.
168 public:
169 using StreamId = k32u;
170
171 public:
178 GoStreamResponse() = default;
179 ~GoStreamResponse() = default;
180
188 GoStreamResponse(const GoJson& fullmsg);
189
198 GoStreamResponse::StreamId StreamIdentifier() const;
199
208 const std::string StreamStatus() const;
209 };
210
211 }
212
213 #endif
GoPxLSdk::GoJson
Simplify working with json data.
Definition: GoJson.h:38
GoResponseType.h
GoPxLSdkClass
#define GoPxLSdkClass
Definition: Def.h:35
Def.h
Declares the general SDK definitions.
GoPxLSdk::GoResponseType
Definition: GoResponseType.h:15
GoPxLSdk::GoStreamResponse::StreamId
k32u StreamId
Definition: GoResponse.h:169
GoPxLSdk::GoStreamResponse
Represents streamed data.
Definition: GoResponse.h:163
GoPxLSdk::GoNotificationType
Definition: GoNotificationType.h:17
GoJson.h
GoPxLSdk::GoRequestResponse
Represents a response to requests such as Read/Update.
Definition: GoResponse.h:101
GoNotificationType.h
GoPxLSdk::GoNotificationResponse
Represents a response to change notifications.
Definition: GoResponse.h:127
GoPxLSdk::GoResponseType::Request
A reply to a request (e.g. Read or Update).
Definition: GoResponseType.h:20
GoPxLSdk::GoResponse
Definition: GoResponse.h:24
GoPxLSdk
Definition: Def.h:46