From 3baaf982217fbc818965e8ed71c3ec91e96844d5 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 20 Jan 2019 21:41:27 +0100 Subject: [PATCH] In C++, classes don't need a name because they have a class --- src/bindings/java/JavaContext.cpp | 2 +- src/kernel/context/Context.hpp | 6 +----- src/kernel/context/ContextBoost.hpp | 2 -- src/kernel/context/ContextRaw.hpp | 2 -- src/kernel/context/ContextSwapped.cpp | 3 +-- src/kernel/context/ContextSwapped.hpp | 2 +- src/kernel/context/ContextThread.cpp | 3 +-- src/kernel/context/ContextUnix.hpp | 2 -- 8 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/bindings/java/JavaContext.cpp b/src/bindings/java/JavaContext.cpp index 4a742fd7a1..c8b6db532a 100644 --- a/src/bindings/java/JavaContext.cpp +++ b/src/bindings/java/JavaContext.cpp @@ -27,7 +27,7 @@ ContextFactory* java_factory() return new JavaContextFactory(); } -JavaContextFactory::JavaContextFactory(): ContextFactory("JavaContextFactory") +JavaContextFactory::JavaContextFactory() : ContextFactory() { xbt_binary_name = xbt_strdup("java"); // Used by the backtrace displayer } diff --git a/src/kernel/context/Context.hpp b/src/kernel/context/Context.hpp index 10ddbe6000..50fc40b7f0 100644 --- a/src/kernel/context/Context.hpp +++ b/src/kernel/context/Context.hpp @@ -20,11 +20,8 @@ namespace kernel { namespace context { class XBT_PUBLIC ContextFactory { -private: - std::string name_; - public: - explicit ContextFactory(std::string name) : name_(std::move(name)) {} + explicit ContextFactory() {} virtual ~ContextFactory(); virtual Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) = 0; @@ -34,7 +31,6 @@ public: virtual Context* create_maestro(std::function code, smx_actor_t process); virtual void run_all() = 0; - std::string const& name() const { return name_; } protected: template T* new_context(Args&&... args) diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index d78cc2336d..239bcfafb5 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -61,8 +61,6 @@ private: class BoostContextFactory : public SwappedContextFactory { public: - BoostContextFactory() : SwappedContextFactory("BoostContextFactory") {} - Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override; }; }}} // namespace diff --git a/src/kernel/context/ContextRaw.hpp b/src/kernel/context/ContextRaw.hpp index a27e81b33b..1ddb3b5ae7 100644 --- a/src/kernel/context/ContextRaw.hpp +++ b/src/kernel/context/ContextRaw.hpp @@ -47,8 +47,6 @@ private: class RawContextFactory : public SwappedContextFactory { public: - RawContextFactory() : SwappedContextFactory("RawContextFactory") {} - Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override; }; }}} // namespace diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index 1d18cc5916..7775167df7 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -37,8 +37,7 @@ namespace context { /* rank of the execution thread */ thread_local uintptr_t SwappedContext::worker_id_; /* thread-specific storage for the thread id */ -SwappedContextFactory::SwappedContextFactory(std::string name) - : ContextFactory(name), parallel_(SIMIX_context_is_parallel()) +SwappedContextFactory::SwappedContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel()) { parmap_ = nullptr; // will be created lazily with the right parameters if needed (ie, in parallel) workers_context_.clear(); diff --git a/src/kernel/context/ContextSwapped.hpp b/src/kernel/context/ContextSwapped.hpp index ad618f9796..286211b045 100644 --- a/src/kernel/context/ContextSwapped.hpp +++ b/src/kernel/context/ContextSwapped.hpp @@ -18,7 +18,7 @@ class SwappedContext; class SwappedContextFactory : public ContextFactory { friend SwappedContext; // Reads whether we are in parallel mode public: - explicit SwappedContextFactory(std::string name); + SwappedContextFactory(); ~SwappedContextFactory() override; void run_all() override; diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 64188a62f8..994935398f 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -22,8 +22,7 @@ namespace context { // ThreadContextFactory -ThreadContextFactory::ThreadContextFactory() - : ContextFactory("ThreadContextFactory"), parallel_(SIMIX_context_is_parallel()) +ThreadContextFactory::ThreadContextFactory() : ContextFactory(), parallel_(SIMIX_context_is_parallel()) { if (parallel_) ParallelThreadContext::initialize(); diff --git a/src/kernel/context/ContextUnix.hpp b/src/kernel/context/ContextUnix.hpp index d3b3659509..1c8d7da5fa 100644 --- a/src/kernel/context/ContextUnix.hpp +++ b/src/kernel/context/ContextUnix.hpp @@ -46,8 +46,6 @@ private: class UContextFactory : public SwappedContextFactory { public: - UContextFactory() : SwappedContextFactory("UContextFactory") {} - Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override; }; }}} // namespace -- 2.20.1