Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In C++, classes don't need a name because they have a class
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 20 Jan 2019 20:41:27 +0000 (21:41 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 20 Jan 2019 21:56:17 +0000 (22:56 +0100)
src/bindings/java/JavaContext.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextBoost.hpp
src/kernel/context/ContextRaw.hpp
src/kernel/context/ContextSwapped.cpp
src/kernel/context/ContextSwapped.hpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextUnix.hpp

index 4a742fd..c8b6db5 100644 (file)
@@ -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
 }
index 10ddbe6..50fc40b 100644 (file)
@@ -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<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) = 0;
 
@@ -34,7 +31,6 @@ public:
   virtual Context* create_maestro(std::function<void()> code, smx_actor_t process);
 
   virtual void run_all() = 0;
-  std::string const& name() const { return name_; }
 
 protected:
   template <class T, class... Args> T* new_context(Args&&... args)
index d78cc23..239bcfa 100644 (file)
@@ -61,8 +61,6 @@ private:
 
 class BoostContextFactory : public SwappedContextFactory {
 public:
-  BoostContextFactory() : SwappedContextFactory("BoostContextFactory") {}
-
   Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
 };
 }}} // namespace
index a27e81b..1ddb3b5 100644 (file)
@@ -47,8 +47,6 @@ private:
 
 class RawContextFactory : public SwappedContextFactory {
 public:
-  RawContextFactory() : SwappedContextFactory("RawContextFactory") {}
-
   Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
 };
 }}} // namespace
index 1d18cc5..7775167 100644 (file)
@@ -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();
index ad618f9..286211b 100644 (file)
@@ -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;
 
index 64188a6..9949353 100644 (file)
@@ -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();
index d3b3659..1c8d7da 100644 (file)
@@ -46,8 +46,6 @@ private:
 
 class UContextFactory : public SwappedContextFactory {
 public:
-  UContextFactory() : SwappedContextFactory("UContextFactory") {}
-
   Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override;
 };
 }}} // namespace