Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[s4u] Activity ought not to be copied
[simgrid.git] / include / simgrid / s4u / Activity.hpp
index 533a92d..0b8d303 100644 (file)
@@ -7,18 +7,17 @@
 #ifndef SIMGRID_S4U_ACTIVITY_HPP
 #define SIMGRID_S4U_ACTIVITY_HPP
 
-#include <stdlib.h>
+#include <cstdlib>
+
 #include <xbt/base.h>
 #include <xbt/misc.h>
 
 #include <simgrid/s4u/forward.hpp>
-#include "simgrid/forward.h"
+#include <simgrid/forward.h>
 
-SG_BEGIN_DECL();
 typedef enum {
   inited, started, finished
 } e_s4u_activity_state_t;
-SG_END_DECL();
 
 namespace simgrid {
 namespace s4u {
@@ -32,13 +31,11 @@ XBT_PUBLIC_CLASS Activity {
 protected:
   Activity();
   virtual ~Activity();
-  
-private:
-  simgrid::simix::Synchro *pimpl_ = NULL;
 
-private:
-  e_s4u_activity_state_t state_ = inited;
 public:
+  Activity(Activity const&) = delete;
+  Activity& operator=(Activity const&) = delete;
+
   /** Starts a previously created activity.
    *
    * This function is optional: you can call wait() even if you didn't call start()
@@ -56,9 +53,6 @@ public:
   /** Retrieve the current state of the activity */
   e_s4u_activity_state_t getState() {return state_;}
 
-private:
-  double remains_ = 0;
-public:
   /** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
   double getRemains();
   /** Set the [remaining] amount of work that this Activity will entail
@@ -66,13 +60,16 @@ public:
    * It is forbidden to change the amount of work once the Activity is started */
   void setRemains(double remains);
 
-private:
-  void *userData_ = NULL;
-public:
   /** Put some user data onto the Activity */
   void setUserData(void *data) {userData_=data;}
   /** Retrieve the user data of the Activity */
   void *getUserData() { return userData_; }
+
+private:
+  simgrid::simix::Synchro *pimpl_ = nullptr;
+  e_s4u_activity_state_t state_ = inited;
+  double remains_ = 0;
+  void *userData_ = nullptr;
 }; // class
 
 }}; // Namespace simgrid::s4u