You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bb...@apache.org on 2017/11/29 14:04:00 UTC

[1/2] mesos git commit: Added generic stringification of hashmap of stringifiable types.

Repository: mesos
Updated Branches:
  refs/heads/master d6d40ecad -> ae08193d7


Added generic stringification of hashmap of stringifiable types.

This patch adds generic stringification for hashmaps of stringifiable
types to stout. Related, but less generic functions are currently
implemented in both 'v1/mesos.hpp' and 'v1/type_utils.hpp'; these
implementations will be removed in a subsequent commit.

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


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

Branch: refs/heads/master
Commit: a230e144d5c4c8f18f0893a5e8492de6a73870fa
Parents: d6d40ec
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Wed Nov 29 09:51:06 2017 +0100
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Wed Nov 29 09:51:06 2017 +0100

----------------------------------------------------------------------
 3rdparty/stout/include/stout/hashmap.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a230e144/3rdparty/stout/include/stout/hashmap.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/hashmap.hpp b/3rdparty/stout/include/stout/hashmap.hpp
index faf8002..91085b8 100644
--- a/3rdparty/stout/include/stout/hashmap.hpp
+++ b/3rdparty/stout/include/stout/hashmap.hpp
@@ -14,6 +14,7 @@
 #define __STOUT_HASHMAP_HPP__
 
 #include <functional>
+#include <iosfwd>
 #include <list>
 #include <map>
 #include <unordered_map>
@@ -139,4 +140,11 @@ public:
   }
 };
 
+
+template <typename K, typename V>
+std::ostream& operator<<(std::ostream& stream, const hashmap<K, V>& map)
+{
+  return stream << stringify(map);
+}
+
 #endif // __STOUT_HASHMAP_HPP__


[2/2] mesos git commit: Removed stringification for hashmaps of strings.

Posted by bb...@apache.org.
Removed stringification for hashmaps of strings.

More generic hashmap stringification functions for hashmaps of
stringifiable types were added to stout in a previous commit. This
patch removes more specialized implementations in favor of the more
generic one provided by stout itself now.

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


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

Branch: refs/heads/master
Commit: ae08193d7901413f3bd1b7d720140af5d51d4eab
Parents: a230e14
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Wed Nov 29 09:51:16 2017 +0100
Committer: Benjamin Bannier <bb...@apache.org>
Committed: Wed Nov 29 15:01:22 2017 +0100

----------------------------------------------------------------------
 include/mesos/type_utils.hpp | 6 ------
 src/common/type_utils.cpp    | 6 ------
 src/v1/mesos.cpp             | 6 ------
 3 files changed, 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ae08193d/include/mesos/type_utils.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/type_utils.hpp b/include/mesos/type_utils.hpp
index f7f2327..8de3f76 100644
--- a/include/mesos/type_utils.hpp
+++ b/include/mesos/type_utils.hpp
@@ -27,7 +27,6 @@
 
 #include <mesos/mesos.hpp>
 
-#include <stout/hashmap.hpp>
 #include <stout/stringify.hpp>
 #include <stout/strings.hpp>
 #include <stout/uuid.hpp>
@@ -462,11 +461,6 @@ inline std::ostream& operator<<(
   return stream;
 }
 
-
-std::ostream& operator<<(
-    std::ostream& stream,
-    const hashmap<std::string, std::string>& map);
-
 } // namespace mesos {
 
 namespace std {

http://git-wip-us.apache.org/repos/asf/mesos/blob/ae08193d/src/common/type_utils.cpp
----------------------------------------------------------------------
diff --git a/src/common/type_utils.cpp b/src/common/type_utils.cpp
index 1426755..c10f21f 100644
--- a/src/common/type_utils.cpp
+++ b/src/common/type_utils.cpp
@@ -717,10 +717,4 @@ ostream& operator<<(ostream& stream, const Secret::Type& secretType)
   return stream << Secret::Type_Name(secretType);
 }
 
-
-ostream& operator<<(ostream& stream, const hashmap<string, string>& map)
-{
-  return stream << stringify(map);
-}
-
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/ae08193d/src/v1/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/v1/mesos.cpp b/src/v1/mesos.cpp
index 44767b1..dcf323e 100644
--- a/src/v1/mesos.cpp
+++ b/src/v1/mesos.cpp
@@ -625,11 +625,5 @@ ostream& operator<<(ostream& stream, const Secret::Type& secretType)
   return stream << Secret::Type_Name(secretType);
 }
 
-
-ostream& operator<<(ostream& stream, const hashmap<string, string>& map)
-{
-  return stream << stringify(map);
-}
-
 } // namespace v1 {
 } // namespace mesos {