- template<class R, class A1, class A2, class A3, class A4, class A5>
- int call(unsigned int proc, const A1 & a1, const A2 & a2, const A3 & a3,
- const A4 & a4, const A5 & a5, R &r);
- private:
- template<class R> int call_m(unsigned int proc, marshall &req, R &r);
-};
-
-template<class R>
-int rsm_client::call_m(unsigned int proc, marshall &req, R &r) {
- std::string rep;
- std::string res;
- int intret = invoke(proc, req.str(), rep);
- VERIFY( intret == rsm_client_protocol::OK );
- unmarshall u(rep);
- u >> intret;
- if (intret < 0) return intret;
- u >> res;
- if (!u.okdone()) {
- fprintf(stderr, "rsm_client::call_m: failed to unmarshall the reply.\n"
- "You probably forgot to set the reply string in "
- "rsm::client_invoke, or you may call RPC 0x%x with wrong return "
- "type\n", proc);
- VERIFY(0);
- return rpc_const::unmarshal_reply_failure;
- }
- unmarshall u1(res);
- u1 >> r;
- if(!u1.okdone()) {
- fprintf(stderr, "rsm_client::call_m: failed to unmarshall the reply.\n"
- "You are probably calling RPC 0x%x with wrong return "
- "type.\n", proc);
- VERIFY(0);
- return rpc_const::unmarshal_reply_failure;
+ template<class P, class R, class ...Args>
+ int call(rpc_protocol::proc_t<P> proc, R & r, const Args & ...a1) {
+ static_assert(is_valid_call<P, R, Args...>::value, "RSM method invoked with incorrect argument types");
+ return call_m(proc.id, r, marshall(a1...));