| 1 | /************************************************************************* |
| 2 | * libjson-rpc-cpp |
| 3 | ************************************************************************* |
| 4 | * @file rpcprotocolserver12.h |
| 5 | * @date 10/25/2014 |
| 6 | * @author Peter Spiess-Knafl <dev@spiessknafl.at> |
| 7 | * @license See attached LICENSE.txt |
| 8 | ************************************************************************/ |
| 9 | |
| 10 | #ifndef JSONRPC_RPCPROTOCOLSERVER12_H |
| 11 | #define JSONRPC_RPCPROTOCOLSERVER12_H |
| 12 | |
| 13 | #include "abstractprotocolhandler.h" |
| 14 | #include "rpcprotocolserverv1.h" |
| 15 | #include "rpcprotocolserverv2.h" |
| 16 | |
| 17 | namespace jsonrpc { |
| 18 | |
| 19 | class RpcProtocolServer12 : public IProtocolHandler { |
| 20 | public: |
| 21 | RpcProtocolServer12(IProcedureInvokationHandler &handler); |
| 22 | |
| 23 | void AddProcedure(const Procedure &procedure); |
| 24 | void HandleRequest(const std::string &request, std::string &retValue); |
| 25 | |
| 26 | private: |
| 27 | RpcProtocolServerV1 rpc1; |
| 28 | RpcProtocolServerV2 rpc2; |
| 29 | |
| 30 | AbstractProtocolHandler &GetHandler(const Json::Value &request); |
| 31 | }; |
| 32 | |
| 33 | } // namespace jsonrpc |
| 34 | |
| 35 | #endif // JSONRPC_RPCPROTOCOLSERVER12_H |
| 36 | |