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 <benjamin.bann...@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__
 
 

Reply via email to