You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 05:25:18 UTC

svn commit: r1131578 - /incubator/mesos/trunk/src/third_party/libprocess/tuple-impl.hpp

Author: benh
Date: Sun Jun  5 03:25:18 2011
New Revision: 1131578

URL: http://svn.apache.org/viewvc?rev=1131578&view=rev
Log:
Added Tuple::post support (have not compiled or tested).

Modified:
    incubator/mesos/trunk/src/third_party/libprocess/tuple-impl.hpp

Modified: incubator/mesos/trunk/src/third_party/libprocess/tuple-impl.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/tuple-impl.hpp?rev=1131578&r1=1131577&r2=1131578&view=diff
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/tuple-impl.hpp (original)
+++ incubator/mesos/trunk/src/third_party/libprocess/tuple-impl.hpp Sun Jun  5 03:25:18 2011
@@ -865,4 +865,68 @@ protected:
   {
     return call(to, pack<ID>(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9), secs);
   }
+
+public:
+  template <MSGID ID>
+  static void post(const PID &, const tuple<ID> &r)
+  {
+    std::ostringstream os;
+
+    process::serialization::serializer s(os);
+
+    if (size<ID>::value >= 1) {
+      const typename field<0, ID>::type &temp = at<0>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 2) {
+      const typename field<1, ID>::type &temp = at<1>(r);
+      s & temp;
+    }
+ 
+    if (size<ID>::value >= 3) {
+      const typename field<2, ID>::type &temp = at<2>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 4) {
+      const typename field<3, ID>::type &temp = at<3>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 5) {
+      const typename field<4, ID>::type &temp = at<4>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 6) {
+      const typename field<5, ID>::type &temp = at<5>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 7) {
+      const typename field<6, ID>::type &temp = at<6>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 8) {
+      const typename field<7, ID>::type &temp = at<7>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 9) {
+      const typename field<8, ID>::type &temp = at<8>(r);
+      s & temp;
+    }
+
+    if (size<ID>::value >= 10) {
+      const typename field<9, ID>::type &temp = at<9>(r);
+      s & temp;
+    }
+
+    std::string data = os.str();
+
+    Process::post(to, ID, data.data(), data.size());    
+  }
+
 };