You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2014/01/22 22:41:59 UTC

[6/8] git commit: Added a List type in stout.

Added a List type in stout.

Review: https://reviews.apache.org/r/17029


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/99e84172
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/99e84172
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/99e84172

Branch: refs/heads/master
Commit: 99e841724252796374cf826cbbb0249bb725d9a2
Parents: 20d3d44
Author: Benjamin Mahler <bm...@twitter.com>
Authored: Thu Jan 16 19:31:34 2014 -0800
Committer: Benjamin Mahler <bm...@twitter.com>
Committed: Wed Jan 22 13:03:11 2014 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/3rdparty/stout/Makefile.am  |  1 +
 .../3rdparty/stout/include/stout/list.hpp       | 41 ++++++++++++++++++++
 2 files changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/99e84172/3rdparty/libprocess/3rdparty/stout/Makefile.am
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/Makefile.am b/3rdparty/libprocess/3rdparty/stout/Makefile.am
index d83ad25..5d5a760 100644
--- a/3rdparty/libprocess/3rdparty/stout/Makefile.am
+++ b/3rdparty/libprocess/3rdparty/stout/Makefile.am
@@ -28,6 +28,7 @@ EXTRA_DIST =					\
   include/stout/json.hpp			\
   include/stout/lambda.hpp			\
   include/stout/linkedhashmap.hpp		\
+  include/stout/list.hpp			\
   include/stout/memory.hpp			\
   include/stout/multihashmap.hpp		\
   include/stout/multimap.hpp			\

http://git-wip-us.apache.org/repos/asf/mesos/blob/99e84172/3rdparty/libprocess/3rdparty/stout/include/stout/list.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/list.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/list.hpp
new file mode 100644
index 0000000..60f0c8c
--- /dev/null
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/list.hpp
@@ -0,0 +1,41 @@
+#ifndef __STOUT_LIST_HPP__
+#define __STOUT_LIST_HPP__
+
+/**
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <list>
+
+#include <stout/preprocessor.hpp>
+
+template <typename T>
+class List : public std::list<T>
+{
+public:
+  List() {}
+
+  // TODO(bmahler): Revisit when C++11 is required: we'll be able to
+  // use the std::list constructor with an std::initiliazer_list.
+#define INSERT(z, N, _) std::list<T>::push_back( t ## N );
+#define TEMPLATE(Z, N, DATA) \
+  List(ENUM_PARAMS(N, const T& t)) \
+  { \
+    REPEAT_FROM_TO(0, N, INSERT, _) \
+  }
+
+  REPEAT_FROM_TO(1, 21, TEMPLATE, _) // Args T1 -> T21.
+#undef TEMPLATE
+#undef INSERT
+};
+
+#endif // __STOUT_LIST_HPP__