X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/e0c49ff6ba44cf5b47ab91d58b67763f5a1c7a58..02967a43024ce81912cd1ec96a800397457f8066:/rsm_client.h diff --git a/rsm_client.h b/rsm_client.h index 90b5b06..32dde43 100644 --- a/rsm_client.h +++ b/rsm_client.h @@ -19,15 +19,15 @@ class rsm_client { std::mutex rsm_client_mutex; void primary_failure(lock & rsm_client_mutex_lock); bool init_members(lock & rsm_client_mutex_lock); - rsm_protocol::status invoke(unsigned int proc, string & rep, const string & req); - template int call_m(unsigned int proc, R & r, const marshall & req); + rsm_protocol::status invoke(rpc_protocol::proc_id_t proc, string & rep, const string & req); + template int call_marshalled(rpc_protocol::proc_t & proc, R & r, const marshall & req); public: rsm_client(string dst); template - inline int call(rpc_protocol::proc_t

proc, R & r, const Args & ...a1) { + inline int call(rpc_protocol::proc_checked_t

proc, R & r, const Args & ...a1) { static_assert(is_valid_call::value, "RSM method invoked with incorrect argument types"); - return call_m(proc.id, r, marshall(a1...)); + return call_marshalled(proc, r, marshall(a1...)); } }; @@ -41,9 +41,9 @@ inline string hexify(const string & s) { } template -int rsm_client::call_m(unsigned int proc, R & r, const marshall & req) { +int rsm_client::call_marshalled(rpc_protocol::proc_t & proc, R & r, const marshall & req) { string rep; - int intret = invoke(proc, rep, req.content()); + int intret = invoke(proc.id, rep, req.content()); VERIFY( intret == rsm_client_protocol::OK ); unmarshall u(rep, false, intret); if (intret < 0) return intret; @@ -53,15 +53,15 @@ int rsm_client::call_m(unsigned int proc, R & r, const marshall & req) { LOG << "failed to unmarshall the reply."; LOG << "You probably forgot to set the reply string in " << "rsm::client_invoke, or you may have called RPC " - << "0x" << std::hex << proc << " with the wrong return type"; + << proc.name << " (0x" << std::hex << proc.id << ") with the wrong return type"; LOG << "here's what I got: \"" << hexify(rep) << "\""; VERIFY(0); return rpc_protocol::unmarshall_reply_failure; } if(!unmarshall(res, false, r).okdone()) { LOG << "failed to unmarshall the reply."; - LOG << "You are probably calling RPC 0x" << std::hex << proc - << " with the wrong return type."; + LOG << "You are probably calling RPC " << proc.name << " (0x" + << std::hex << proc.id << ") with the wrong return type."; LOG << "here's what I got: \"" << hexify(res) << "\""; VERIFY(0); return rpc_protocol::unmarshall_reply_failure;