You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/10/17 09:57:22 UTC

[1/5] mesos git commit: Consistently used virtual inheritance for Flags classes in mesos.

Repository: mesos
Updated Branches:
  refs/heads/master e9888d15d -> 82c520eb0


Consistently used virtual inheritance for Flags classes in mesos.

In order for different `Flags` classes to be composable classes should
always use virtual inheritance.

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


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

Branch: refs/heads/master
Commit: 82c520eb0d83710e3f0ed4514348f893c2b44455
Parents: bb90338
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Oct 14 18:56:07 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Mon Oct 17 05:34:41 2016 -0400

----------------------------------------------------------------------
 src/cli/execute.cpp                                       |  2 +-
 src/docker/executor.hpp                                   |  2 +-
 src/examples/balloon_framework.cpp                        |  2 +-
 src/examples/disk_full_framework.cpp                      |  2 +-
 src/examples/load_generator_framework.cpp                 |  2 +-
 src/examples/long_lived_framework.cpp                     |  2 +-
 src/examples/no_executor_framework.cpp                    |  2 +-
 src/examples/persistent_volume_framework.cpp              |  2 +-
 src/launcher/executor.cpp                                 |  2 +-
 src/local/flags.hpp                                       |  2 +-
 src/log/tool/benchmark.hpp                                |  2 +-
 src/log/tool/initialize.hpp                               |  2 +-
 src/log/tool/read.hpp                                     |  2 +-
 src/log/tool/replica.hpp                                  |  2 +-
 src/master/flags.hpp                                      |  2 +-
 src/sched/flags.hpp                                       |  2 +-
 src/scheduler/flags.hpp                                   |  2 +-
 src/slave/container_loggers/lib_logrotate.hpp             |  2 +-
 .../containerizer/mesos/isolators/network/cni/cni.hpp     |  2 +-
 .../mesos/isolators/network/port_mapping.hpp              |  4 ++--
 src/slave/containerizer/mesos/launch.hpp                  |  2 +-
 src/slave/containerizer/mesos/mount.hpp                   |  2 +-
 src/slave/flags.hpp                                       |  2 +-
 src/tests/active_user_test_helper.hpp                     |  2 +-
 src/tests/containerizer/capabilities_test_helper.hpp      |  2 +-
 src/tests/flags.hpp                                       |  2 +-
 src/uri/fetcher.hpp                                       | 10 +++++-----
 27 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/cli/execute.cpp
----------------------------------------------------------------------
diff --git a/src/cli/execute.cpp b/src/cli/execute.cpp
index 600542b..94ac463 100644
--- a/src/cli/execute.cpp
+++ b/src/cli/execute.cpp
@@ -86,7 +86,7 @@ using process::Owned;
 using process::UPID;
 
 
-class Flags : public flags::FlagsBase
+class Flags : public virtual flags::FlagsBase
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/docker/executor.hpp
----------------------------------------------------------------------
diff --git a/src/docker/executor.hpp b/src/docker/executor.hpp
index a49ec1b..495fad5 100644
--- a/src/docker/executor.hpp
+++ b/src/docker/executor.hpp
@@ -32,7 +32,7 @@ namespace mesos {
 namespace internal {
 namespace docker {
 
-struct Flags : public mesos::internal::logging::Flags
+struct Flags : public virtual mesos::internal::logging::Flags
 {
   Flags() {
     add(&container,

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/examples/balloon_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/balloon_framework.cpp b/src/examples/balloon_framework.cpp
index 5613ff0..50add6a 100644
--- a/src/examples/balloon_framework.cpp
+++ b/src/examples/balloon_framework.cpp
@@ -58,7 +58,7 @@ const double CPUS_PER_TASK = 0.1;
 const double CPUS_PER_EXECUTOR = 0.1;
 const int32_t MEM_PER_EXECUTOR = 64;
 
-class Flags : public flags::FlagsBase
+class Flags : public virtual flags::FlagsBase
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/examples/disk_full_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/disk_full_framework.cpp b/src/examples/disk_full_framework.cpp
index 1221f83..78f13d3 100644
--- a/src/examples/disk_full_framework.cpp
+++ b/src/examples/disk_full_framework.cpp
@@ -57,7 +57,7 @@ const int MEMORY_PER_TASK = 16;
 const Bytes DISK_PER_TASK = Megabytes(5);
 
 
-class Flags : public flags::FlagsBase
+class Flags : public virtual flags::FlagsBase
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/examples/load_generator_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/load_generator_framework.cpp b/src/examples/load_generator_framework.cpp
index 5402e31..81c8c23 100644
--- a/src/examples/load_generator_framework.cpp
+++ b/src/examples/load_generator_framework.cpp
@@ -224,7 +224,7 @@ private:
 };
 
 
-class Flags : public mesos::internal::logging::Flags
+class Flags : public virtual mesos::internal::logging::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/examples/long_lived_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/long_lived_framework.cpp b/src/examples/long_lived_framework.cpp
index 7c57eb5..bfb253e 100644
--- a/src/examples/long_lived_framework.cpp
+++ b/src/examples/long_lived_framework.cpp
@@ -460,7 +460,7 @@ private:
 };
 
 
-class Flags : public flags::FlagsBase
+class Flags : public virtual flags::FlagsBase
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/examples/no_executor_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/no_executor_framework.cpp b/src/examples/no_executor_framework.cpp
index 5742572..4668542 100644
--- a/src/examples/no_executor_framework.cpp
+++ b/src/examples/no_executor_framework.cpp
@@ -231,7 +231,7 @@ private:
 };
 
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/examples/persistent_volume_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/persistent_volume_framework.cpp b/src/examples/persistent_volume_framework.cpp
index 3cc7cf0..a2a6944 100644
--- a/src/examples/persistent_volume_framework.cpp
+++ b/src/examples/persistent_volume_framework.cpp
@@ -376,7 +376,7 @@ private:
 };
 
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/launcher/executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/executor.cpp b/src/launcher/executor.cpp
index 3e95d60..dec1e07 100644
--- a/src/launcher/executor.cpp
+++ b/src/launcher/executor.cpp
@@ -816,7 +816,7 @@ private:
 } // namespace mesos {
 
 
-class Flags : public flags::FlagsBase
+class Flags : public virtual flags::FlagsBase
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/local/flags.hpp
----------------------------------------------------------------------
diff --git a/src/local/flags.hpp b/src/local/flags.hpp
index c77eff1..3d8e539 100644
--- a/src/local/flags.hpp
+++ b/src/local/flags.hpp
@@ -27,7 +27,7 @@ namespace mesos {
 namespace internal {
 namespace local {
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/log/tool/benchmark.hpp
----------------------------------------------------------------------
diff --git a/src/log/tool/benchmark.hpp b/src/log/tool/benchmark.hpp
index e905e85..b58a659 100644
--- a/src/log/tool/benchmark.hpp
+++ b/src/log/tool/benchmark.hpp
@@ -32,7 +32,7 @@ namespace tool {
 class Benchmark : public Tool
 {
 public:
-  class Flags : public logging::Flags
+  class Flags : public virtual logging::Flags
   {
   public:
     Flags();

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/log/tool/initialize.hpp
----------------------------------------------------------------------
diff --git a/src/log/tool/initialize.hpp b/src/log/tool/initialize.hpp
index 33d2c5c..8d4fab1 100644
--- a/src/log/tool/initialize.hpp
+++ b/src/log/tool/initialize.hpp
@@ -33,7 +33,7 @@ namespace tool {
 class Initialize : public Tool
 {
 public:
-  class Flags : public logging::Flags
+  class Flags : public virtual logging::Flags
   {
   public:
     Flags();

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/log/tool/read.hpp
----------------------------------------------------------------------
diff --git a/src/log/tool/read.hpp b/src/log/tool/read.hpp
index 7ec8275..00b8617 100644
--- a/src/log/tool/read.hpp
+++ b/src/log/tool/read.hpp
@@ -35,7 +35,7 @@ namespace tool {
 class Read : public Tool
 {
 public:
-  class Flags : public logging::Flags
+  class Flags : public virtual logging::Flags
   {
   public:
     Flags();

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/log/tool/replica.hpp
----------------------------------------------------------------------
diff --git a/src/log/tool/replica.hpp b/src/log/tool/replica.hpp
index 9ca92ae..456ad12 100644
--- a/src/log/tool/replica.hpp
+++ b/src/log/tool/replica.hpp
@@ -35,7 +35,7 @@ namespace tool {
 class Replica : public Tool
 {
 public:
-  class Flags : public logging::Flags
+  class Flags : public virtual logging::Flags
   {
   public:
     Flags();

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/master/flags.hpp
----------------------------------------------------------------------
diff --git a/src/master/flags.hpp b/src/master/flags.hpp
index 708a629..6a17b76 100644
--- a/src/master/flags.hpp
+++ b/src/master/flags.hpp
@@ -37,7 +37,7 @@ namespace mesos {
 namespace internal {
 namespace master {
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags();

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/sched/flags.hpp
----------------------------------------------------------------------
diff --git a/src/sched/flags.hpp b/src/sched/flags.hpp
index 8782c7b..d19d20b 100644
--- a/src/sched/flags.hpp
+++ b/src/sched/flags.hpp
@@ -31,7 +31,7 @@ namespace mesos {
 namespace internal {
 namespace scheduler {
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/scheduler/flags.hpp
----------------------------------------------------------------------
diff --git a/src/scheduler/flags.hpp b/src/scheduler/flags.hpp
index 6d0e95e..1e8efc0 100644
--- a/src/scheduler/flags.hpp
+++ b/src/scheduler/flags.hpp
@@ -25,7 +25,7 @@ namespace mesos {
 namespace v1 {
 namespace scheduler {
 
-class Flags : public mesos::internal::local::Flags
+class Flags : public virtual mesos::internal::local::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/slave/container_loggers/lib_logrotate.hpp
----------------------------------------------------------------------
diff --git a/src/slave/container_loggers/lib_logrotate.hpp b/src/slave/container_loggers/lib_logrotate.hpp
index d6e4f95..f91db3e 100644
--- a/src/slave/container_loggers/lib_logrotate.hpp
+++ b/src/slave/container_loggers/lib_logrotate.hpp
@@ -103,7 +103,7 @@ struct LoggerFlags : public virtual flags::FlagsBase
 };
 
 
-struct Flags : public LoggerFlags
+struct Flags : public virtual LoggerFlags
 {
   Flags()
   {

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/slave/containerizer/mesos/isolators/network/cni/cni.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/network/cni/cni.hpp b/src/slave/containerizer/mesos/isolators/network/cni/cni.hpp
index 70f3083..a6861fc 100644
--- a/src/slave/containerizer/mesos/isolators/network/cni/cni.hpp
+++ b/src/slave/containerizer/mesos/isolators/network/cni/cni.hpp
@@ -195,7 +195,7 @@ class NetworkCniIsolatorSetup : public Subcommand
 public:
   static const char* NAME;
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/slave/containerizer/mesos/isolators/network/port_mapping.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/network/port_mapping.hpp b/src/slave/containerizer/mesos/isolators/network/port_mapping.hpp
index e852c46..9d38289 100644
--- a/src/slave/containerizer/mesos/isolators/network/port_mapping.hpp
+++ b/src/slave/containerizer/mesos/isolators/network/port_mapping.hpp
@@ -352,7 +352,7 @@ class PortMappingUpdate : public Subcommand
 public:
   static const char* NAME;
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 
@@ -381,7 +381,7 @@ class PortMappingStatistics : public Subcommand
 public:
   static const char* NAME;
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/slave/containerizer/mesos/launch.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/launch.hpp b/src/slave/containerizer/mesos/launch.hpp
index cfbf790..f8bac06 100644
--- a/src/slave/containerizer/mesos/launch.hpp
+++ b/src/slave/containerizer/mesos/launch.hpp
@@ -34,7 +34,7 @@ class MesosContainerizerLaunch : public Subcommand
 public:
   static const std::string NAME;
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/slave/containerizer/mesos/mount.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/mount.hpp b/src/slave/containerizer/mesos/mount.hpp
index fcfe860..f6fbe04 100644
--- a/src/slave/containerizer/mesos/mount.hpp
+++ b/src/slave/containerizer/mesos/mount.hpp
@@ -37,7 +37,7 @@ public:
   static const std::string NAME;
   static const std::string MAKE_RSLAVE;
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/slave/flags.hpp
----------------------------------------------------------------------
diff --git a/src/slave/flags.hpp b/src/slave/flags.hpp
index ec619f8..3c292ba 100644
--- a/src/slave/flags.hpp
+++ b/src/slave/flags.hpp
@@ -35,7 +35,7 @@ namespace mesos {
 namespace internal {
 namespace slave {
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags();

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/tests/active_user_test_helper.hpp
----------------------------------------------------------------------
diff --git a/src/tests/active_user_test_helper.hpp b/src/tests/active_user_test_helper.hpp
index b99d1e4..0232520 100644
--- a/src/tests/active_user_test_helper.hpp
+++ b/src/tests/active_user_test_helper.hpp
@@ -27,7 +27,7 @@ class ActiveUserTestHelper : public Subcommand
 public:
   static const char NAME[];
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/tests/containerizer/capabilities_test_helper.hpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/capabilities_test_helper.hpp b/src/tests/containerizer/capabilities_test_helper.hpp
index 256ee3b..240bd5f 100644
--- a/src/tests/containerizer/capabilities_test_helper.hpp
+++ b/src/tests/containerizer/capabilities_test_helper.hpp
@@ -33,7 +33,7 @@ class CapabilitiesTestHelper : public Subcommand
 public:
   static const char NAME[];
 
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags();
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/tests/flags.hpp
----------------------------------------------------------------------
diff --git a/src/tests/flags.hpp b/src/tests/flags.hpp
index 3066399..cab2416 100644
--- a/src/tests/flags.hpp
+++ b/src/tests/flags.hpp
@@ -34,7 +34,7 @@ namespace mesos {
 namespace internal {
 namespace tests {
 
-class Flags : public logging::Flags
+class Flags : public virtual logging::Flags
 {
 public:
   Flags()

http://git-wip-us.apache.org/repos/asf/mesos/blob/82c520eb/src/uri/fetcher.hpp
----------------------------------------------------------------------
diff --git a/src/uri/fetcher.hpp b/src/uri/fetcher.hpp
index 949363e..7b91010 100644
--- a/src/uri/fetcher.hpp
+++ b/src/uri/fetcher.hpp
@@ -38,14 +38,14 @@ namespace fetcher {
  * The combined flags for all built-in plugins.
  */
 class Flags :
-  public CopyFetcherPlugin::Flags,
+  public virtual CopyFetcherPlugin::Flags,
 #ifdef __WINDOWS__
   // TODO(dpravat): Add support for Hadoop and Docker plugins. See MESOS-5473.
-  public CurlFetcherPlugin::Flags {};
+  public virtual CurlFetcherPlugin::Flags {};
 #else
-  public CurlFetcherPlugin::Flags,
-  public HadoopFetcherPlugin::Flags,
-  public DockerFetcherPlugin::Flags {};
+  public virtual CurlFetcherPlugin::Flags,
+  public virtual HadoopFetcherPlugin::Flags,
+  public virtual DockerFetcherPlugin::Flags {};
 #endif // __WINDOWS__
 
 


[5/5] mesos git commit: Deleted potentially implicitly generated functions.

Posted by mp...@apache.org.
Deleted potentially implicitly generated functions.

Here we explicitly disable rvalue constructors and assignment
operators for `flags::FlagsBase` since we plan for this class to be
used in virtual inheritance scenarios.  Here e.g., constructing from
an rvalue will be problematic since we can potentially have multiple
lineages leading to the same base class, and could then potentially
use a moved from base object.

These functions would be implicitly generated only for C++14, but in
C++11 only the versions taking lvalue references should be. GCC seems
to create all of these even in C++11 mode so we need to explicitly
disable them.

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


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

Branch: refs/heads/master
Commit: 5d491eb77a9268feaec0587e79808e7805907317
Parents: da2aa2c
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Mon Oct 17 05:33:17 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Mon Oct 17 05:34:41 2016 -0400

----------------------------------------------------------------------
 3rdparty/stout/include/stout/flags/flags.hpp | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5d491eb7/3rdparty/stout/include/stout/flags/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/flags/flags.hpp b/3rdparty/stout/include/stout/flags/flags.hpp
index 3c2ad4a..e00aedf 100644
--- a/3rdparty/stout/include/stout/flags/flags.hpp
+++ b/3rdparty/stout/include/stout/flags/flags.hpp
@@ -45,7 +45,23 @@ class FlagsBase
 {
 public:
   FlagsBase() { add(&help, "help", "Prints this help message", false); }
-  virtual ~FlagsBase() {}
+  virtual ~FlagsBase() = default;
+
+  // Explicitly disable rvalue constructors and assignment operators
+  // since we plan for this class to be used in virtual inheritance
+  // scenarios. Here e.g., constructing from an rvalue will be
+  // problematic since we can potentially have multiple lineages
+  // leading to the same base class, and could then potentially use a
+  // moved from base object.
+  // All of the following functions would be implicitly generated for
+  // C++14, but in C++11 only the versions taking lvalue references
+  // should be. GCC seems to create all of these even in C++11 mode so
+  // we need to explicitly disable them.
+  FlagsBase(const FlagsBase&) = default;
+  FlagsBase(FlagsBase&&) = delete;
+  FlagsBase& operator=(const FlagsBase&) = default;
+  FlagsBase& operator=(FlagsBase&&) = delete;
+
 
   // Load any flags from the environment given the variable prefix,
   // i.e., given prefix 'STOUT_' will load a flag named 'foo' via


[2/5] mesos git commit: Consistently used virtual inheritance for Flags classes in stout.

Posted by mp...@apache.org.
Consistently used virtual inheritance for Flags classes in stout.

In order for different `Flags` classes to be composable classes should
always use virtual inheritance.

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


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

Branch: refs/heads/master
Commit: 16914ae87b999223e26d63415b56d5aca4bf8b2b
Parents: 5d491eb
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Oct 14 18:56:02 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Mon Oct 17 05:34:41 2016 -0400

----------------------------------------------------------------------
 3rdparty/stout/tests/flags_tests.cpp      | 14 ++++----------
 3rdparty/stout/tests/subcommand_tests.cpp |  2 +-
 2 files changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/16914ae8/3rdparty/stout/tests/flags_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/flags_tests.cpp b/3rdparty/stout/tests/flags_tests.cpp
index 50d7c17..b2de02d 100644
--- a/3rdparty/stout/tests/flags_tests.cpp
+++ b/3rdparty/stout/tests/flags_tests.cpp
@@ -45,7 +45,7 @@ using utils::arraySize;
 
 // Just used to test that the default implementation
 // of --help and 'usage()' works as intended.
-class EmptyFlags : public FlagsBase {};
+class EmptyFlags : public virtual FlagsBase {};
 
 
 class TestFlags : public virtual FlagsBase
@@ -725,7 +725,7 @@ TEST(FlagsTest, MissingRequiredFlag)
 TEST(FlagsTest, Validate)
 {
   // To provide validation functions.
-  class ValidatingTestFlags : public TestFlags
+  class ValidatingTestFlags : public virtual FlagsBase
   {
   public:
     ValidatingTestFlags()
@@ -835,24 +835,18 @@ TEST(FlagsTest, EmptyUsage)
 TEST(FlagsTest, ProgramName)
 {
   // To test with a custom program name.
-  class MyTestFlags : public TestFlags
+  class MyTestFlags : public virtual FlagsBase
   {
   public:
     MyTestFlags() { programName_ = "TestProgram"; }
   };
 
-
   MyTestFlags flags;
 
   EXPECT_EQ(
       "Usage: TestProgram [options]\n"
       "\n"
-      "  --[no-]help       Prints this help message (default: false)\n"
-      "  --name1=VALUE     Set name1 (default: ben folds)\n"
-      "  --name2=VALUE     Set name2 (default: 42)\n"
-      "  --[no-]name3      Set name3 (default: false)\n"
-      "  --[no-]name4      Set name4\n"
-      "  --[no-]name5      Set name5\n",
+      "  --[no-]help     Prints this help message (default: false)\n",
       flags.usage());
 }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/16914ae8/3rdparty/stout/tests/subcommand_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/subcommand_tests.cpp b/3rdparty/stout/tests/subcommand_tests.cpp
index 9213d6b..9cdb1ad 100644
--- a/3rdparty/stout/tests/subcommand_tests.cpp
+++ b/3rdparty/stout/tests/subcommand_tests.cpp
@@ -29,7 +29,7 @@ using std::vector;
 class TestSubcommand : public Subcommand
 {
 public:
-  struct Flags : public flags::FlagsBase
+  struct Flags : public virtual flags::FlagsBase
   {
     Flags()
     {


[3/5] mesos git commit: Removed `flags::Flags` helper template.

Posted by mp...@apache.org.
Removed `flags::Flags` helper template.

The template `flags::Flags` allowed to compose flags classes on the
fly, e.g.,

    flags::Flags<MyFlags1, MyFlags2> flags;

which would create a class inheriting virtually from both `MyFlags1`
and `MyFlags2`.

This class was not used in the code.

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


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

Branch: refs/heads/master
Commit: da2aa2c14796b64b19002b86b3b6b9a443479ba8
Parents: e9888d1
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Oct 14 18:55:55 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Mon Oct 17 05:34:41 2016 -0400

----------------------------------------------------------------------
 3rdparty/stout/include/stout/flags.hpp       |  4 +++-
 3rdparty/stout/include/stout/flags/flags.hpp | 20 --------------------
 3rdparty/stout/tests/flags_tests.cpp         | 11 +++++------
 3 files changed, 8 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/da2aa2c1/3rdparty/stout/include/stout/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/flags.hpp b/3rdparty/stout/include/stout/flags.hpp
index 21257b7..b23b6f6 100644
--- a/3rdparty/stout/include/stout/flags.hpp
+++ b/3rdparty/stout/include/stout/flags.hpp
@@ -55,7 +55,9 @@
 // You can also compose flags provided that each has used "virtual
 // inheritance":
 //  -------------------------------------------------------------
-// Flags<MyFlags1, MyFlags2> flags;
+// class MyFlags : public virtual MyFlags1, public virtual MyFlags2 {};
+//
+// MyFlags flags;
 // flags.add(...); // Any other flags you want to throw in there.
 // flags.load(values);
 // flags.flag_from_myflags1 ...

http://git-wip-us.apache.org/repos/asf/mesos/blob/da2aa2c1/3rdparty/stout/include/stout/flags/flags.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/flags/flags.hpp b/3rdparty/stout/include/stout/flags/flags.hpp
index 794a598..3c2ad4a 100644
--- a/3rdparty/stout/include/stout/flags/flags.hpp
+++ b/3rdparty/stout/include/stout/flags/flags.hpp
@@ -17,8 +17,6 @@
 #include <map>
 #include <ostream>
 #include <string>
-#include <tuple>
-#include <type_traits>
 #include <typeinfo> // For typeid.
 #include <vector>
 
@@ -402,24 +400,6 @@ private:
 };
 
 
-template <typename... FlagsTypes>
-class Flags : public virtual FlagsTypes...
-{
-  // Construct tuple types of sizeof...(FlagsTypes) compile-time bools to check
-  // non-recursively that all FlagsTypes derive from FlagsBase; as a helper we
-  // use is_object<FlagTypes> to construct sizeof...(FlagTypes) true types for
-  // the RHS (is_object<T> is a true type for anything one would inherit from).
-  static_assert(
-    std::is_same<
-      std::tuple<typename std::is_base_of<FlagsBase, FlagsTypes>::type...>,
-      std::tuple<typename std::is_object<FlagsTypes>::type...>>::value,
-    "Can only instantiate Flags with FlagsBase types.");
-};
-
-template <>
-class Flags<> : public virtual FlagsBase {};
-
-
 template <typename T1, typename T2, typename F>
 void FlagsBase::add(
     T1* t1,

http://git-wip-us.apache.org/repos/asf/mesos/blob/da2aa2c1/3rdparty/stout/tests/flags_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/tests/flags_tests.cpp b/3rdparty/stout/tests/flags_tests.cpp
index 201b16a..50d7c17 100644
--- a/3rdparty/stout/tests/flags_tests.cpp
+++ b/3rdparty/stout/tests/flags_tests.cpp
@@ -33,7 +33,6 @@
 #include <stout/tests/utils.hpp>
 
 using flags::Flag;
-using flags::Flags;
 using flags::FlagsBase;
 using flags::Warnings;
 
@@ -112,7 +111,7 @@ TEST(FlagsTest, Load)
 
 TEST(FlagsTest, Add)
 {
-  Flags<TestFlags> flags;
+  TestFlags flags;
 
   Option<string> name6;
 
@@ -879,7 +878,7 @@ TEST(FlagsTest, OptionalMessage)
 
 TEST(FlagsTest, Duration)
 {
-  Flags<TestFlags> flags;
+  TestFlags flags;
 
   Duration name6;
 
@@ -909,7 +908,7 @@ TEST(FlagsTest, Duration)
 
 TEST(FlagsTest, JSON)
 {
-  Flags<TestFlags> flags;
+  TestFlags flags;
 
   Option<JSON::Object> json;
 
@@ -944,7 +943,7 @@ class FlagsFileTest : public TemporaryDirectoryTest {};
 // assumes filesystems are rooted at '/'. See MESOS-5937.
 TEST_F_TEMP_DISABLED_ON_WINDOWS(FlagsFileTest, JSONFile)
 {
-  Flags<TestFlags> flags;
+  TestFlags flags;
 
   Option<JSON::Object> json;
 
@@ -979,7 +978,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FlagsFileTest, JSONFile)
 
 TEST_F(FlagsFileTest, FilePrefix)
 {
-  Flags<TestFlags> flags;
+  TestFlags flags;
 
   Option<string> something;
 


[4/5] mesos git commit: Consistently used virtual inheritance for Flags classes in libprocess.

Posted by mp...@apache.org.
Consistently used virtual inheritance for Flags classes in libprocess.

In order for different `Flags` classes to be composable classes should
always use virtual inheritance.

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


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

Branch: refs/heads/master
Commit: bb903381fa8b98c1f16bd8af69c727d501ba99e9
Parents: 16914ae
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Oct 14 18:56:04 2016 -0400
Committer: Michael Park <mp...@apache.org>
Committed: Mon Oct 17 05:34:41 2016 -0400

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/subprocess_tests.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bb903381/3rdparty/libprocess/src/tests/subprocess_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/subprocess_tests.cpp b/3rdparty/libprocess/src/tests/subprocess_tests.cpp
index 483ac1c..630a714 100644
--- a/3rdparty/libprocess/src/tests/subprocess_tests.cpp
+++ b/3rdparty/libprocess/src/tests/subprocess_tests.cpp
@@ -619,7 +619,7 @@ TEST_F(SubprocessTest, Default)
 #endif // __WINDOWS__
 
 
-struct Flags : public flags::FlagsBase
+struct Flags : public virtual flags::FlagsBase
 {
   Flags()
   {