Split out marshall code into a new file
[invirt/third/libt4.git] / rpc / rpc.h
index d81a5dd..f01af09 100644 (file)
--- a/rpc/rpc.h
+++ b/rpc/rpc.h
@@ -1,20 +1,13 @@
 #ifndef rpc_h
 #define rpc_h
 
+#include "types.h"
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <list>
-#include <map>
-#include <stdio.h>
 
 #include "thr_pool.h"
 #include "marshall.h"
 #include "connection.h"
-#include "lock.h"
-
-using std::string;
-using std::map;
-using std::list;
 
 class rpc_const {
     public:
@@ -37,13 +30,12 @@ class rpcc : public chanmgr {
 
         //manages per rpc info
         struct caller {
-            caller(int xxid, unmarshall *un);
-            ~caller();
+            caller(int _xid, unmarshall *_un) : xid(_xid), un(_un) {}
 
             int xid;
             unmarshall *un;
             int intret;
-            bool done;
+            bool done = false;
             mutex m;
             cond c;
         };
@@ -126,9 +118,8 @@ rpcc::call_m(proc_t proc, marshall &req, R & r, TO to)
     if (intret < 0) return intret;
     u >> r;
     if (u.okdone() != true) {
-        fprintf(stderr, "rpcc::call_m: failed to unmarshall the reply."
-                "You are probably calling RPC 0x%x with wrong return "
-                "type.\n", proc);
+        cerr << "rpcc::call_m: failed to unmarshall the reply.  You are probably " <<
+                "calling RPC 0x" << hex << proc << " with the wrong return type." << endl;
         VERIFY(0);
         return rpc_const::unmarshal_reply_failure;
     }