Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Replace "XBT_PUBLIC_CLASS" with "class XBT_PUBLIC".
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 13 Mar 2018 14:37:00 +0000 (15:37 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 13 Mar 2018 16:00:10 +0000 (17:00 +0100)
39 files changed:
doc/Doxyfile.in
include/simgrid/jedule/jedule.hpp
include/simgrid/jedule/jedule_events.hpp
include/simgrid/jedule/jedule_platform.hpp
include/simgrid/s4u/Activity.hpp
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/simgrid/s4u/Engine.hpp
include/simgrid/s4u/Exec.hpp
include/simgrid/s4u/Host.hpp
include/simgrid/s4u/Link.hpp
include/simgrid/s4u/Mailbox.hpp
include/simgrid/s4u/Mutex.hpp
include/simgrid/s4u/NetZone.hpp
include/simgrid/s4u/Storage.hpp
include/simgrid/s4u/VirtualMachine.hpp
include/xbt/base.h
include/xbt/config.hpp
include/xbt/exception.hpp
include/xbt/string.hpp
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/SleepImpl.hpp
src/kernel/activity/SynchroIo.hpp
src/kernel/activity/SynchroRaw.hpp
src/kernel/context/Context.hpp
src/kernel/lmm/maxmin.hpp
src/kernel/resource/Action.hpp
src/kernel/resource/Model.hpp
src/kernel/resource/Resource.hpp
src/kernel/routing/DragonflyZone.hpp
src/kernel/routing/NetZoneImpl.hpp
src/mc/mc_exit.hpp
src/plugins/file_system/FileSystem.hpp
src/plugins/vm/VirtualMachineImpl.hpp
src/surf/cpu_interface.hpp
src/surf/trace_mgr.hpp

index 07d802a..301509a 100644 (file)
@@ -1457,7 +1457,6 @@ PREDEFINED             = XBT_PUBLIC= \
                          XBT_EXPORT_NO_IMPORT(type)=type \
                          XBT_IMPORT_NO_EXPORT(type)=type \
                          XBT_PUBLIC_DATA(type)="extern type" \
-                         XBT_PUBLIC_CLASS=class \
                          XBT_INLINE= \
                         XBT_PRIVATE=
 
index eb25b52..6a19881 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -17,8 +17,7 @@
 namespace simgrid {
 namespace jedule{
 
-
-XBT_PUBLIC_CLASS Jedule {
+class XBT_PUBLIC Jedule {
 public:
   Jedule()=default;
   ~Jedule();
index 704d4f6..6f57c01 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 namespace simgrid {
 namespace jedule{
 
-XBT_PUBLIC_CLASS Event{
-  public:
-    Event(std::string name, double start_time, double end_time, std::string type);
-    ~Event();
-    void addCharacteristic(char *characteristic);
-    void addResources(std::vector<sg_host_t> *host_selection);
-    void addInfo(char *key, char *value);
-    void print(FILE *file);
-
-  private:
-    std::string name;
-    double start_time;
-    double end_time;
-    std::string type;
-    std::vector<jed_subset_t> *resource_subsets;
-    std::vector<char*> characteristics_list; /* just a list of names (strings) */
-    std::unordered_map<char*, char*> info_map;     /* key/value pairs */
+class XBT_PUBLIC Event {
+public:
+  Event(std::string name, double start_time, double end_time, std::string type);
+  ~Event();
+  void addCharacteristic(char* characteristic);
+  void addResources(std::vector<sg_host_t>* host_selection);
+  void addInfo(char* key, char* value);
+  void print(FILE* file);
+
+private:
+  std::string name;
+  double start_time;
+  double end_time;
+  std::string type;
+  std::vector<jed_subset_t>* resource_subsets;
+  std::vector<char*> characteristics_list;   /* just a list of names (strings) */
+  std::unordered_map<char*, char*> info_map; /* key/value pairs */
 };
 }
 }
 
 extern "C" {
-typedef simgrid::jedule::Event * jed_event_t;
+typedef simgrid::jedule::Event* jed_event_t;
 }
 
 #endif
index 9510ad0..d7a7b4c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2012, 2014-2017. The SimGrid Team.
+/* Copyright (c) 2010-2012, 2014-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -17,7 +17,7 @@
 
 namespace simgrid {
 namespace jedule{
-XBT_PUBLIC_CLASS Container {
+class XBT_PUBLIC Container {
 public:
   Container(std::string name);
   virtual ~Container();
@@ -39,7 +39,7 @@ public:
   void printResources(FILE *file);
 };
 
-XBT_PUBLIC_CLASS Subset {
+class XBT_PUBLIC Subset {
 public:
   Subset(int s, int n, Container* p);
   virtual ~Subset()=default;
index 905daa3..b5ef0b4 100644 (file)
@@ -18,7 +18,7 @@ namespace s4u {
  *
  * This class is the ancestor of every activities that an actor can undertake, that is, of the actions that do take time in the simulated world.
  */
-XBT_PUBLIC_CLASS Activity {
+class XBT_PUBLIC Activity {
   friend Comm;
   friend XBT_PUBLIC void intrusive_ptr_release(Comm * c);
   friend XBT_PUBLIC void intrusive_ptr_add_ref(Comm * c);
index b4cdc75..598721c 100644 (file)
@@ -129,8 +129,7 @@ namespace s4u {
  */
 
 /** @brief Simulation Agent */
-XBT_PUBLIC_CLASS Actor : public simgrid::xbt::Extendable<Actor>
-{
+class XBT_PUBLIC Actor : public simgrid::xbt::Extendable<Actor> {
   friend Exec;
   friend Mailbox;
   friend simgrid::simix::ActorImpl;
index 36a4308..230e30e 100644 (file)
@@ -21,8 +21,7 @@ namespace s4u {
  *
  * Represents all asynchronous communications, that you can test or wait onto.
  */
-XBT_PUBLIC_CLASS Comm : public Activity
-{
+class XBT_PUBLIC Comm : public Activity {
   Comm() : Activity() {}
 public:
   friend XBT_PUBLIC void intrusive_ptr_release(simgrid::s4u::Comm * c);
index 5efc7f9..1bd6e11 100644 (file)
@@ -30,8 +30,7 @@ namespace s4u {
  *  semantic. But we currently use (only) double for both durations and
  *  timestamp timeouts.
  */
-XBT_PUBLIC_CLASS ConditionVariable
-{
+class XBT_PUBLIC ConditionVariable {
 private:
   friend s_smx_cond_t;
   smx_cond_t cond_;
index 570900a..232f0f0 100644 (file)
@@ -24,8 +24,7 @@ namespace s4u {
  *
  * This class is an interface to the simulation engine.
  */
-XBT_PUBLIC_CLASS Engine
-{
+class XBT_PUBLIC Engine {
 public:
   /** Constructor, taking the command line parameters of your main function */
   Engine(int* argc, char** argv);
index 9566d53..43a0031 100644 (file)
@@ -15,8 +15,7 @@
 namespace simgrid {
 namespace s4u {
 
-XBT_PUBLIC_CLASS Exec : public Activity
-{
+class XBT_PUBLIC Exec : public Activity {
   Exec() : Activity() {}
 public:
   friend XBT_PUBLIC void intrusive_ptr_release(simgrid::s4u::Exec * e);
index d1b329b..092908e 100644 (file)
@@ -37,8 +37,7 @@ namespace s4u {
  * You can retrieve a particular host using simgrid::s4u::Host::byName()
  * and actors can retrieve the host on which they run using simgrid::s4u::Host::current().
  */
-XBT_PUBLIC_CLASS Host : public simgrid::xbt::Extendable<Host>
-{
+class XBT_PUBLIC Host : public simgrid::xbt::Extendable<Host> {
 
 public:
   explicit Host(const char* name);
index 13619bc..8376304 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -23,8 +23,7 @@ class NetworkAction;
 };
 namespace s4u {
 /** @brief A Link represents the network facilities between [hosts](\ref simgrid::s4u::Host) */
-XBT_PUBLIC_CLASS Link : public simgrid::xbt::Extendable<Link>
-{
+class XBT_PUBLIC Link : public simgrid::xbt::Extendable<Link> {
   friend simgrid::surf::LinkImpl;
 
   // Links are created from the NetZone, and destroyed by their private implementation when the simulation ends
index 4b6a905..642ce4a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -104,7 +104,7 @@ namespace s4u {
  *
  * @section s4u_mb_api The API
  */
-XBT_PUBLIC_CLASS Mailbox {
+class XBT_PUBLIC Mailbox {
   friend Comm;
   friend simgrid::kernel::activity::MailboxImpl;
 
index 81263d9..6d58988 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -33,7 +33,7 @@ class ConditionVariable;
  * Use createMutex() to get a ::MutexPtr to a newly created mutex and only manipulate ::MutexPtr.
  *
  */
-XBT_PUBLIC_CLASS Mutex {
+class XBT_PUBLIC Mutex {
   friend ConditionVariable;
   friend simgrid::kernel::activity::MutexImpl;
   simgrid::kernel::activity::MutexImpl* mutex_;
index 778d179..a1935b7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2017. The SimGrid Team. All rights reserved.               */
+/* Copyright (c) 2016-2018. The SimGrid Team. All rights reserved.               */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -28,8 +28,7 @@ namespace s4u {
  * netzones. In SimGrid, there is a hierarchy of netzones, with a unique root zone (that you can retrieve from the
  * s4u::Engine).
  */
-XBT_PUBLIC_CLASS NetZone
-{
+class XBT_PUBLIC NetZone {
 protected:
   friend simgrid::kernel::routing::NetZoneImpl;
 
index 7dd83db..5366365 100644 (file)
@@ -23,8 +23,7 @@ namespace s4u {
 
 XBT_PUBLIC void getStorageList(std::map<std::string, Storage*>* whereTo);
 
-XBT_PUBLIC_CLASS Storage : public simgrid::xbt::Extendable<Storage>
-{
+class XBT_PUBLIC Storage : public simgrid::xbt::Extendable<Storage> {
   friend s4u::Engine;
   friend simgrid::surf::StorageImpl;
 
index 2ec81c7..ea9aff0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -31,8 +31,7 @@ namespace s4u {
  * The total computing power that the contained actors can get is constrained to the virtual machine size.
  *
  */
-XBT_PUBLIC_CLASS VirtualMachine : public s4u::Host
-{
+class XBT_PUBLIC VirtualMachine : public s4u::Host {
   simgrid::vm::VirtualMachineImpl* pimpl_vm_ = nullptr;
   virtual ~VirtualMachine();
 
index e0ab206..644917a 100644 (file)
 #  define XBT_EXPORT_NO_IMPORT(type)  __declspec(dllexport) type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern __declspec(dllexport) type
-#  define XBT_PUBLIC_CLASS            class __declspec(dllexport)
 #  define XBT_PRIVATE
 
 /* Link against the DLL */
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  __declspec(dllimport) type
 #  define XBT_PUBLIC_DATA(type)       extern __declspec(dllimport) type
-#  define XBT_PUBLIC_CLASS            class __declspec(dllimport)
 #  define XBT_PRIVATE
 
 #elif defined(__ELF__)
 #  define XBT_EXPORT_NO_IMPORT(type)  __attribute__((visibility("default"))) type
 #  define XBT_IMPORT_NO_EXPORT(type)  __attribute__((visibility("default"))) type
 #  define XBT_PUBLIC_DATA(type)       extern __attribute__((visibility("default"))) type
-#  define XBT_PUBLIC_CLASS            class __attribute__((visibility("default")))
 #  define XBT_PRIVATE                 __attribute__((visibility("hidden")))
 
 #else
 #  define XBT_EXPORT_NO_IMPORT(type)  type
 #  define XBT_IMPORT_NO_EXPORT(type)  type
 #  define XBT_PUBLIC_DATA(type)       extern type
-#  define XBT_PUBLIC_CLASS            class
 #  define XBT_PRIVATE                 /** @private */
 
 #endif
index 5585106..a4e7517 100644 (file)
@@ -23,7 +23,7 @@
 namespace simgrid {
 namespace config {
 
-XBT_PUBLIC_CLASS missing_key_error : public std::runtime_error {
+class XBT_PUBLIC missing_key_error : public std::runtime_error {
 public:
   explicit missing_key_error(const std::string& what)
     : std::runtime_error(what) {}
index 3d648a1..8fa032d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2005-2017. The SimGrid Team.All rights reserved. */
+/* Copyright (c) 2005-2018. The SimGrid Team.All rights reserved. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -65,7 +65,7 @@ class ThrowPoint {
  *  However, you can try `dynamic_cast` an exception to this type in order to
  *  get contextual information about the exception.
  */
-XBT_PUBLIC_CLASS WithContextException {
+class XBT_PUBLIC WithContextException {
 public:
   WithContextException() :
     backtrace_(simgrid::xbt::backtrace()),
index 15bf86d..bb237f0 100644 (file)
@@ -54,7 +54,7 @@ struct string_data {
  *  * the [C++11-conforming implementation](https://gcc.gnu.org/gcc-5/changes.html)
  *    does not use refcouting/COW but has a small string optimization.
  */
-XBT_PUBLIC_CLASS string : private string_data {
+class XBT_PUBLIC string : private string_data {
   static char NUL;
 
 public:
index 2119210..dba9a7a 100644 (file)
@@ -19,25 +19,25 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-  XBT_PUBLIC_CLASS ActivityImpl {
-  public:
-    ActivityImpl();
-    virtual ~ActivityImpl();
-    e_smx_state_t state = SIMIX_WAITING; /* State of the activity */
-    std::string name;                    /* Activity name if any */
-    std::list<smx_simcall_t> simcalls;   /* List of simcalls waiting for this activity */
-
-    virtual void suspend()=0;
-    virtual void resume()=0;
-    virtual void post() =0; // What to do when a simcall terminates
-
-    // boost::intrusive_ptr<ActivityImpl> support:
-    friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl * activity);
-    friend XBT_PUBLIC void intrusive_ptr_release(ActivityImpl * activity);
-
-  private:
-    std::atomic_int_fast32_t refcount_{0};
-  };
+class XBT_PUBLIC ActivityImpl {
+public:
+  ActivityImpl();
+  virtual ~ActivityImpl();
+  e_smx_state_t state = SIMIX_WAITING; /* State of the activity */
+  std::string name;                    /* Activity name if any */
+  std::list<smx_simcall_t> simcalls;   /* List of simcalls waiting for this activity */
+
+  virtual void suspend() = 0;
+  virtual void resume()  = 0;
+  virtual void post()    = 0; // What to do when a simcall terminates
+
+  // boost::intrusive_ptr<ActivityImpl> support:
+  friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
+  friend XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
+
+private:
+  std::atomic_int_fast32_t refcount_{0};
+};
 }}} // namespace simgrid::kernel::activity
 
 #endif /* SIMGRID_KERNEL_ACTIVITY_ACTIVITYIMPL_HPP */
index 86e44d1..849f605 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -15,8 +15,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-XBT_PUBLIC_CLASS CommImpl : public ActivityImpl
-{
+class XBT_PUBLIC CommImpl : public ActivityImpl {
   ~CommImpl() override;
 
 public:
index 4b11447..17f82ae 100644 (file)
@@ -13,8 +13,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-XBT_PUBLIC_CLASS ExecImpl : public ActivityImpl
-{
+class XBT_PUBLIC ExecImpl : public ActivityImpl {
   ~ExecImpl() override;
 
 public:
index 38c781f..2713736 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -13,8 +13,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-XBT_PUBLIC_CLASS SleepImpl : public ActivityImpl
-{
+class XBT_PUBLIC SleepImpl : public ActivityImpl {
 public:
   void suspend() override;
   void resume() override;
index b7f7e1b..03efd48 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -13,8 +13,7 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
-XBT_PUBLIC_CLASS IoImpl : public ActivityImpl
-{
+class XBT_PUBLIC IoImpl : public ActivityImpl {
 public:
   void suspend() override;
   void resume() override;
index eaa8e9c..40b3887 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -14,8 +14,7 @@ namespace kernel {
 namespace activity {
 
   /** Used to implement mutexes, semaphores and conditions */
-XBT_PUBLIC_CLASS RawImpl : public ActivityImpl
-{
+class XBT_PUBLIC RawImpl : public ActivityImpl {
 public:
   ~RawImpl() override;
   void suspend() override;
index 9699703..d33af39 100644 (file)
@@ -37,103 +37,84 @@ namespace simgrid {
 namespace kernel {
 namespace context {
 
-  XBT_PUBLIC_CLASS ContextFactory {
-  private:
-    std::string name_;
-  public:
-
-    explicit ContextFactory(std::string name) : name_(std::move(name)) {}
-    virtual ~ContextFactory();
-    virtual Context* create_context(std::function<void()> code,
-      void_pfn_smxprocess_t cleanup, smx_actor_t process) = 0;
-
-    // Optional methods for attaching main() as a context:
-
-    /** Creates a context from the current context of execution
+class XBT_PUBLIC ContextFactory {
+private:
+  std::string name_;
+
+public:
+  explicit ContextFactory(std::string name) : name_(std::move(name)) {}
+  virtual ~ContextFactory();
+  virtual Context* create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t process) = 0;
+
+  // Optional methods for attaching main() as a context:
+
+  /** Creates a context from the current context of execution
+   *
+   *  This will not work on all implementation of `ContextFactory`.
+   */
+  virtual Context* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
+  virtual Context* create_maestro(std::function<void()> code, smx_actor_t process);
+
+  virtual void run_all() = 0;
+  virtual Context* self();
+  std::string const& name() const { return name_; }
+private:
+  void declare_context(void* T, std::size_t size);
+
+protected:
+  template <class T, class... Args> T* new_context(Args&&... args)
+  {
+    T* context = new T(std::forward<Args>(args)...);
+    this->declare_context(context, sizeof(T));
+    return context;
+  }
+};
+
+class XBT_PUBLIC Context {
+private:
+  std::function<void()> code_;
+  void_pfn_smxprocess_t cleanup_func_ = nullptr;
+  smx_actor_t process_                = nullptr;
+
+public:
+  class StopRequest {
+    /** @brief Exception launched to kill a process, in order to properly unwind its stack and release RAII stuff
      *
-     *  This will not work on all implementation of `ContextFactory`.
+     * Nope, Sonar, this should not inherit of std::exception.
+     * Otherwise, users may accidentally catch it with a try {} catch (std::exception)
      */
-    virtual Context* attach(void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
-    virtual Context* create_maestro(std::function<void()> code, smx_actor_t process);
-
-    virtual void run_all() = 0;
-    virtual Context* self();
-    std::string const& name() const
-    {
-      return name_;
-    }
-  private:
-    void declare_context(void* T, std::size_t size);
-  protected:
-    template<class T, class... Args>
-    T* new_context(Args&&... args)
-    {
-      T* context = new T(std::forward<Args>(args)...);
-      this->declare_context(context, sizeof(T));
-      return context;
-    }
-  };
-
-  XBT_PUBLIC_CLASS Context {
-  private:
-    std::function<void()> code_;
-    void_pfn_smxprocess_t cleanup_func_ = nullptr;
-    smx_actor_t process_ = nullptr;
-  public:
-    class StopRequest {
-      /** @brief Exception launched to kill a process, in order to properly unwind its stack and release RAII stuff
-       *
-       * Nope, Sonar, this should not inherit of std::exception.
-       * Otherwise, users may accidentally catch it with a try {} catch (std::exception)
-       */
-    };
-    bool iwannadie;
-
-    Context(std::function<void()> code,
-            void_pfn_smxprocess_t cleanup_func,
-            smx_actor_t process);
-    void operator()()
-    {
-      code_();
-    }
-    bool has_code() const
-    {
-      return static_cast<bool>(code_);
-    }
-    smx_actor_t process()
-    {
-      return this->process_;
-    }
-    void set_cleanup(void_pfn_smxprocess_t cleanup)
-    {
-      cleanup_func_ = cleanup;
-    }
-
-    // Virtual methods
-    virtual ~Context();
-    virtual void stop();
-    virtual void suspend() = 0;
   };
-
-  XBT_PUBLIC_CLASS AttachContext : public Context {
-  public:
-
-    AttachContext(std::function<void()> code,
-            void_pfn_smxprocess_t cleanup_func,
-            smx_actor_t process)
+  bool iwannadie;
+
+  Context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
+  void operator()() { code_(); }
+  bool has_code() const { return static_cast<bool>(code_); }
+  smx_actor_t process() { return this->process_; }
+  void set_cleanup(void_pfn_smxprocess_t cleanup) { cleanup_func_ = cleanup; }
+
+  // Virtual methods
+  virtual ~Context();
+  virtual void stop();
+  virtual void suspend() = 0;
+};
+
+class XBT_PUBLIC AttachContext : public Context {
+public:
+  AttachContext(std::function<void()> code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
       : Context(std::move(code), cleanup_func, process)
-    {}
+  {
+  }
 
-    ~AttachContext() override;
+  ~AttachContext() override;
 
-    /** Called by the context when it is ready to give control
-     *  to the maestro.
-     */
-    virtual void attach_start() = 0;
+  /** Called by the context when it is ready to give control
+   *  to the maestro.
+   */
+  virtual void attach_start() = 0;
 
-    /** Called by the context when it has finished its job */
-    virtual void attach_stop() = 0;
-  };
+  /** Called by the context when it has finished its job */
+  virtual void attach_stop() = 0;
+};
 
 /* This allows Java to hijack the context factory (Java induces factories of factory :) */
 typedef ContextFactory* (*ContextFactoryInitializer)();
index db0a098..c64d4d6 100644 (file)
@@ -168,8 +168,7 @@ XBT_PUBLIC double func_vegas_fpi(const Variable& var, double x);
  * Then, it is used to list all variables involved in constraint through constraint's xxx_element_set lists, or
  * vice-versa list all constraints for a given variable.
  */
-XBT_PUBLIC_CLASS Element
-{
+class XBT_PUBLIC Element {
 public:
   int get_concurrency() const;
   void decrease_concurrency();
@@ -206,8 +205,7 @@ struct ConstraintLight {
  * \li Active elements which variable's weight is non-zero (i.e. it is enabled) AND its element value is non-zero.
  *     LMM_solve iterates over active elements during resolution, dynamically making them active or unactive.
  */
-XBT_PUBLIC_CLASS Constraint
-{
+class XBT_PUBLIC Constraint {
 public:
   Constraint() = delete;
   Constraint(void* id_value, double bound_value);
@@ -333,8 +331,7 @@ private:
  * When something prevents us from enabling a variable, we "stage" the weight that we would have like to set, so that as
  * soon as possible we enable the variable with desired weight
  */
-XBT_PUBLIC_CLASS Variable
-{
+class XBT_PUBLIC Variable {
 public:
   void initialize(simgrid::kernel::resource::Action * id_value, double sharing_weight_value, double bound_value,
                   int number_of_constraints, unsigned visited_value);
@@ -442,8 +439,7 @@ inline void Element::make_inactive()
 /**
  * @brief LMM system
  */
-XBT_PUBLIC_CLASS System
-{
+class XBT_PUBLIC System {
 public:
   /**
    * @brief Create a new Linear MaxMim system
index 827fccf..ef60eae 100644 (file)
@@ -21,8 +21,7 @@ typedef boost::heap::pairing_heap<heap_element_type, boost::heap::constant_time_
  * @brief SURF action interface class
  * @details An action is an event generated by a resource (e.g.: a communication for the network)
  */
-XBT_PUBLIC_CLASS Action
-{
+class XBT_PUBLIC Action {
 public:
   boost::intrusive::list_member_hook<> modifiedSetHook_; /* Used by the lazy update to list the actions to track */
   bool isLinkedModifiedSet() const { return modifiedSetHook_.is_linked(); }
index e947ad3..f1123d6 100644 (file)
@@ -16,8 +16,7 @@ namespace resource {
  * @brief SURF model interface class
  * @details A model is an object which handle the interactions between its Resources and its Actions
  */
-XBT_PUBLIC_CLASS Model
-{
+class XBT_PUBLIC Model {
 public:
   Model();
   virtual ~Model();
index 8bf9885..c8eb5c6 100644 (file)
@@ -16,8 +16,7 @@ namespace resource {
  * @brief SURF resource interface class
  * @details This is the ancestor class of every resources in SimGrid, such as links, CPU or storage
  */
-XBT_PUBLIC_CLASS Resource
-{
+class XBT_PUBLIC Resource {
 public:
   /**
    * @brief Constructor of LMM Resources
index f676e41..492613b 100644 (file)
@@ -58,7 +58,7 @@ public:
  *    is also not realistic, as blue level can use more links than a single
  *    Aries can handle, thus it should use several routers.
  */
-XBT_PUBLIC_CLASS DragonflyZone : public ClusterZone {
+class XBT_PUBLIC DragonflyZone : public ClusterZone {
 public:
   explicit DragonflyZone(NetZone* father, std::string name);
   ~DragonflyZone() override;
index 9e0b013..acfb8d3 100644 (file)
@@ -48,8 +48,7 @@ class BypassRoute;
  * called Autonomous Systems in this article).
  *
  */
-XBT_PUBLIC_CLASS NetZoneImpl : public s4u::NetZone
-{
+class XBT_PUBLIC NetZoneImpl : public s4u::NetZone {
   friend simgrid::kernel::EngineImpl; // it destroys netRoot_
 
 protected:
index cede412..23d2626 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2015-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 namespace simgrid {
 namespace mc {
-XBT_PUBLIC_CLASS DeadlockError{};
-XBT_PUBLIC_CLASS TerminationError{};
-XBT_PUBLIC_CLASS LivenessError{};
+class XBT_PUBLIC DeadlockError {
+};
+class XBT_PUBLIC TerminationError {
+};
+class XBT_PUBLIC LivenessError {
+};
 }
 }
 
index 6535c3d..d2e742d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -24,8 +24,7 @@ namespace s4u {
  * mountpoints.
  * For now, you cannot change the mountpoints programatically, and must declare them from your platform file.
  */
-XBT_PUBLIC_CLASS File
-{
+class XBT_PUBLIC File {
 public:
   File(std::string fullpath, void* userdata);
   File(std::string fullpath, sg_host_t host, void* userdata);
@@ -70,7 +69,7 @@ private:
   void* userdata_             = nullptr;
 };
 
-XBT_PUBLIC_CLASS FileSystemStorageExt {
+class XBT_PUBLIC FileSystemStorageExt {
 public:
   static simgrid::xbt::Extension<Storage, FileSystemStorageExt> EXTENSION_ID;
   explicit FileSystemStorageExt(Storage* ptr);
@@ -87,8 +86,7 @@ private:
   sg_size_t size_     = 0;
 };
 
-XBT_PUBLIC_CLASS FileDescriptorHostExt
-{
+class XBT_PUBLIC FileDescriptorHostExt {
 public:
   static simgrid::xbt::Extension<Host, FileDescriptorHostExt> EXTENSION_ID;
   FileDescriptorHostExt() = default;
index 3ffbfde..95255c5 100644 (file)
@@ -27,8 +27,7 @@ namespace vm {
  * @brief SURF VM interface class
  * @details A VM represent a virtual machine
  */
-XBT_PUBLIC_CLASS VirtualMachineImpl : public surf::HostImpl, public simgrid::xbt::Extendable<VirtualMachineImpl>
-{
+class XBT_PUBLIC VirtualMachineImpl : public surf::HostImpl, public simgrid::xbt::Extendable<VirtualMachineImpl> {
   friend simgrid::s4u::VirtualMachine;
 
 public:
index fb3f155..47ad57f 100644 (file)
@@ -24,8 +24,7 @@ namespace surf {
  * @brief SURF cpu model interface class
  * @details A model is an object which handle the interactions between its Resources and its Actions
  */
-XBT_PUBLIC_CLASS CpuModel : public kernel::resource::Model
-{
+class XBT_PUBLIC CpuModel : public kernel::resource::Model {
 public:
   /**
    * @brief Create a Cpu
@@ -48,8 +47,7 @@ public:
 * @brief SURF cpu resource interface class
 * @details A Cpu represent a cpu associated to a host
 */
-XBT_PUBLIC_CLASS Cpu : public simgrid::kernel::resource::Resource
-{
+class XBT_PUBLIC Cpu : public simgrid::kernel::resource::Resource {
 public:
   /**
    * @brief Cpu constructor
@@ -144,8 +142,7 @@ public:
  /** @ingroup SURF_cpu_interface
  * @brief A CpuAction represents the execution of code on one or several Cpus
  */
-XBT_PUBLIC_CLASS CpuAction : public simgrid::kernel::resource::Action
-{
+class XBT_PUBLIC CpuAction : public simgrid::kernel::resource::Action {
   friend XBT_PUBLIC Cpu* getActionCpu(CpuAction * action);
 
 public:
index acac83b..28cf319 100644 (file)
@@ -49,8 +49,7 @@ namespace simgrid {
  * - #future_evt_set: makes it easy to find the next occuring event of all traces
  */
 namespace trace_mgr {
-XBT_PUBLIC_CLASS DatedValue
-{
+class XBT_PUBLIC DatedValue {
 public:
   double date_          = 0;
   double value_         = 0;
@@ -62,8 +61,7 @@ public:
 std::ostream& operator<<(std::ostream& out, const DatedValue& e);
 
 /** @brief A trace_iterator links a trace to a resource */
-XBT_PUBLIC_CLASS trace_event{
-
+class XBT_PUBLIC trace_event {
 };
 
 /** @brief A trace is a set of timed values, encoding the value that a variable takes at what time *
@@ -71,7 +69,7 @@ XBT_PUBLIC_CLASS trace_event{
  * It is useful to model dynamic platforms, where an external load that makes the resource availability change over time.
  * To model that, you have to set several traces per resource: one for the on/off state and one for each numerical value (computational speed, bandwidth and latency).
  */
-XBT_PUBLIC_CLASS trace {
+class XBT_PUBLIC trace {
 public:
   /**  Creates an empty trace */
   explicit trace();
@@ -82,7 +80,7 @@ public:
 
 /** @brief Future Event Set (collection of iterators over the traces)
  * That's useful to quickly know which is the next occurring event in a set of traces. */
-XBT_PUBLIC_CLASS future_evt_set {
+class XBT_PUBLIC future_evt_set {
 public:
   future_evt_set();
   virtual ~future_evt_set();