Line data Source code
1 : #pragma once
2 :
3 : #include <pingpong/ipinger.hpp>
4 : #include <pingpong/iponger.hpp>
5 : #include <pingpong/api/ball_json.hpp>
6 : #include <wfc/jsonrpc.hpp>
7 :
8 : namespace demo{ namespace pingpong{ namespace service{
9 :
10 0 : JSONRPC_TAG(ping)
11 0 : JSONRPC_TAG(play)
12 0 : JSONRPC_TAG(pong)
13 :
14 : template<typename Base>
15 0 : class ponger_interface: public Base
16 : {
17 : public:
18 : typedef Base super;
19 : typedef typename super::io_id_t io_id_t;
20 0 : virtual void ping(ball::ptr req, ball::handler cb ) override
21 : {
22 0 : this->template call<_ping_>( std::move(req), cb, nullptr);
23 0 : }
24 : };
25 :
26 0 : struct pinger_method_list: wfc::jsonrpc::method_list
27 : <
28 : wfc::jsonrpc::target<ipinger>,
29 : wfc::jsonrpc::interface_<iponger2>,
30 : wfc::jsonrpc::call_method<_ping_, ball_json, ball_json>,
31 : wfc::jsonrpc::invoke_method< _play_, ball_json, ball_json, ipinger, &ipinger::play>,
32 : wfc::jsonrpc::invoke_method2<
33 : _pong_,
34 : ball_json, ball_json,
35 : ball, ball,
36 : ipinger, &ipinger::pong,
37 : iponger2, &iponger2::ping
38 : >
39 : >
40 : {
41 : };
42 :
43 : }}}
|