-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.h
43 lines (38 loc) · 2.88 KB
/
server.h
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
/**
* This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
*/
#ifndef JSONRPC_CPP_STUB_SERVER_H_
#define JSONRPC_CPP_STUB_SERVER_H_
#include <jsonrpccpp/server.h>
class Server : public jsonrpc::AbstractServer<Server>
{
public:
Server(jsonrpc::AbstractServerConnector &conn, jsonrpc::serverVersion_t type = jsonrpc::JSONRPC_SERVER_V2) : jsonrpc::AbstractServer<Server>(conn, type)
{
this->bindAndAddMethod(jsonrpc::Procedure("set_name", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "action",jsonrpc::JSON_STRING,"student_list",jsonrpc::JSON_ARRAY,"team_name",jsonrpc::JSON_STRING, NULL), &Server::set_nameI);
this->bindAndAddMethod(jsonrpc::Procedure("obtain", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "action",jsonrpc::JSON_STRING,"class_id",jsonrpc::JSON_STRING,"game_id",jsonrpc::JSON_STRING, NULL), &Server::obtainI);
this->bindAndAddMethod(jsonrpc::Procedure("guess", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "action",jsonrpc::JSON_STRING,"class_id",jsonrpc::JSON_STRING,"game_id",jsonrpc::JSON_STRING,"my_guess",jsonrpc::JSON_STRING, NULL), &Server::guessI);
this->bindAndAddMethod(jsonrpc::Procedure("submit", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_OBJECT, "action",jsonrpc::JSON_STRING,"game_id",jsonrpc::JSON_STRING,"team_name",jsonrpc::JSON_STRING, NULL), &Server::submitI);
}
inline virtual void set_nameI(const Json::Value &request, Json::Value &response)
{
response = this->set_name(request["action"].asString(), request["student_list"], request["team_name"].asString());
}
inline virtual void obtainI(const Json::Value &request, Json::Value &response)
{
response = this->obtain(request["action"].asString(), request["class_id"].asString(), request["game_id"].asString());
}
inline virtual void guessI(const Json::Value &request, Json::Value &response)
{
response = this->guess(request["action"].asString(), request["class_id"].asString(), request["game_id"].asString(), request["my_guess"].asString());
}
inline virtual void submitI(const Json::Value &request, Json::Value &response)
{
response = this->submit(request["action"].asString(), request["game_id"].asString(), request["team_name"].asString());
}
virtual Json::Value set_name(const std::string& action, const Json::Value& student_list, const std::string& team_name) = 0;
virtual Json::Value obtain(const std::string& action, const std::string& class_id, const std::string& game_id) = 0;
virtual Json::Value guess(const std::string& action, const std::string& class_id, const std::string& game_id, const std::string& my_guess) = 0;
virtual Json::Value submit(const std::string& action, const std::string& game_id, const std::string& team_name) = 0;
};
#endif //JSONRPC_CPP_STUB_SERVER_H_