Eile Mit Weile
Loading...
Searching...
No Matches
RequestResponse.hpp
1#ifndef EILE_MIT_WEILE_REQUESTRESPONSE_HPP
2#define EILE_MIT_WEILE_REQUESTRESPONSE_HPP
3
4#include <string>
5#include "ServerResponse.hpp"
6
21private:
22 bool _success;
23 std::string _err;
24 std::string _req_id;
25 rapidjson::Value* _state_json = nullptr;
30 RequestResponse(const BaseClassProperties& props, std::string req_id, bool success, rapidjson::Value* state_json, std::string& err);
31
32public:
33
37 RequestResponse(const std::string& game_id, std::string req_id, bool success, rapidjson::Value* state_json, std::string err);
38
43
44 void WriteIntoJson(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator) const override;
45 static RequestResponse* FromJson(const rapidjson::Value& json);
47#ifdef EILE_MIT_WEILE_CLIENT
48 void Process() const override;
55#endif
56
57};
58
59
60#endif //EILE_MIT_WEILE_REQUESTRESPONSE_HPP
Derivative of ServerResponse that is sent as a response to a ClientRequest.
Definition RequestResponse.hpp:20
RequestResponse(const BaseClassProperties &props, std::string req_id, bool success, rapidjson::Value *state_json, std::string &err)
Definition RequestResponse.cpp:11
~RequestResponse()
Definition RequestResponse.cpp:28
std::string _err
Definition RequestResponse.hpp:23
static RequestResponse * FromJson(const rapidjson::Value &json)
Definition RequestResponse.cpp:53
rapidjson::Value * _state_json
Definition RequestResponse.hpp:25
void WriteIntoJson(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Definition RequestResponse.cpp:35
bool _success
Definition RequestResponse.hpp:22
std::string _req_id
Definition RequestResponse.hpp:24
Base class for all messages sent from the server to the client.
Definition ServerResponse.hpp:33
Contains the properties that are common to all ServerResponses.
Definition ServerResponse.hpp:48