Renamed a method that isn't part of the public interface of unmarshall
authorPeter Iannucci <iannucci@mit.edu>
Mon, 30 Sep 2013 18:33:44 +0000 (14:33 -0400)
committerPeter Iannucci <iannucci@mit.edu>
Mon, 30 Sep 2013 18:34:01 +0000 (14:34 -0400)
rpc/marshall.h
rpc/marshall_wrap.h

index 0fcbfaf..597c0fc 100644 (file)
@@ -72,7 +72,7 @@ class unmarshall {
             index_ += n;
         }
 
-        template <class T> void
+        template <class T> inline void
         unpack_header(T & h) {
             VERIFY(sizeof(T)+sizeof(rpc_sz_t) <= RPC_HEADER_SZ);
             // first 4 bytes hold length field
@@ -81,7 +81,7 @@ class unmarshall {
             index_ = RPC_HEADER_SZ;
         }
 
-        template <class T> inline T grab() { T t; *this >> t; return t; }
+        template <class T> inline T _grab() { T t; *this >> t; return t; }
 };
 
 //
@@ -175,10 +175,10 @@ operator<<(marshall &m, const A &x) {
 template <class A> inline typename
 enable_if<supports_emplace_back<A>::value, unmarshall>::type &
 operator>>(unmarshall &u, A &x) {
-    unsigned n = u.grab<unsigned>();
+    unsigned n = u._grab<unsigned>();
     x.clear();
     while (n--)
-        x.emplace_back(u.grab<typename A::value_type>());
+        x.emplace_back(u._grab<typename A::value_type>());
     return u;
 }
 
@@ -196,10 +196,10 @@ operator>>(unmarshall &u, pair<A,B> &d) {
 // std::map<A, B>
 template <class A, class B> inline unmarshall &
 operator>>(unmarshall &u, map<A,B> &x) {
-    unsigned n = u.grab<unsigned>();
+    unsigned n = u._grab<unsigned>();
     x.clear();
     while (n--)
-        x.emplace(u.grab<pair<A,B>>());
+        x.emplace(u._grab<pair<A,B>>());
     return u;
 }
 
@@ -211,7 +211,7 @@ inline marshall & operator<<(marshall &m, const string &s) {
 }
 
 inline unmarshall & operator>>(unmarshall &u, string &s) {
-    uint32_t sz = u.grab<uint32_t>();
+    uint32_t sz = u._grab<uint32_t>();
     if (u.ok()) {
         s.resize(sz);
         u.rawbytes(&s[0], sz);
@@ -230,7 +230,7 @@ operator<<(marshall &m, E e) {
 
 template <class E> typename enable_if<is_enum<E>::value, unmarshall>::type &
 operator>>(unmarshall &u, E &e) {
-    e = to_enum<E>(u.grab<enum_type_t<E>>());
+    e = to_enum<E>(u._grab<enum_type_t<E>>());
     return u;
 }
 
index 2d7fbfb..8d5b15a 100644 (file)
@@ -85,7 +85,7 @@ struct marshalled_func_imp<F, C, RV(R&, Args...), ErrorHandler> {
         return new handler([=](unmarshall &u, marshall &m) -> RV {
             // Unmarshall each argument with the correct type and store the
             // result in a tuple.
-            ArgsStorage t = {u.grab<typename decay<Args>::type>()...};
+            ArgsStorage t = {u._grab<typename decay<Args>::type>()...};
             // Verify successful unmarshalling of the entire input stream.
             if (!u.okdone())
                 return (RV)ErrorHandler::unmarshall_args_failure();