X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/4a160f880ce46153acb23b137f30fd588df5fb9d..6b5e09540e9392a7015fae1ad3b01b0973600ff2:/rsm_client.h diff --git a/rsm_client.h b/rsm_client.h index 2a9c8c4..be66fec 100644 --- a/rsm_client.h +++ b/rsm_client.h @@ -19,14 +19,16 @@ class rsm_client { 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); public: rsm_client(string dst); - rsm_protocol::status invoke(unsigned int proc, string &rep, const string &req); - template - int call(unsigned int proc, R & r, const Args & ...a1); - private: - template int call_m(unsigned int proc, R & r, const marshall & req); + template + int call(rpc_protocol::proc_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...}); + } }; inline string hexify(const string & s) { @@ -55,7 +57,7 @@ int rsm_client::call_m(unsigned int proc, R & r, const marshall & req) { "0x" << hex << proc << " with the wrong return type"); LOG("here's what I got: \"" << hexify(rep) << "\""); VERIFY(0); - return rpc_const::unmarshal_reply_failure; + return rpc_protocol::unmarshal_reply_failure; } unmarshall u1(res, false); u1 >> r; @@ -65,14 +67,9 @@ int rsm_client::call_m(unsigned int proc, R & r, const marshall & req) { " with the wrong return type."); LOG("here's what I got: \"" << hexify(res) << "\""); VERIFY(0); - return rpc_const::unmarshal_reply_failure; + return rpc_protocol::unmarshal_reply_failure; } return intret; } -template -int rsm_client::call(unsigned int proc, R & r, const Args & ...a1) { - return call_m(proc, r, marshall{a1...}); -} - #endif