Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename s4u Async to Activities
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 11 May 2016 08:06:33 +0000 (10:06 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 11 May 2016 08:06:33 +0000 (10:06 +0200)
include/simgrid/s4u.h
include/simgrid/s4u/Activity.hpp [moved from include/simgrid/s4u/async.hpp with 51% similarity]
include/simgrid/s4u/comm.hpp
include/simgrid/s4u/forward.hpp
src/s4u/s4u_activity.cpp [moved from src/s4u/s4u_async.cpp with 65% similarity]
src/s4u/s4u_comm.cpp
tools/cmake/DefinePackages.cmake

index e58b845..42cb73b 100644 (file)
@@ -11,7 +11,7 @@
 #include "s4u/engine.hpp"
 #include "s4u/host.hpp"
 
 #include "s4u/engine.hpp"
 #include "s4u/host.hpp"
 
-#include "s4u/async.hpp"
+#include "s4u/Activity.hpp"
 #include "s4u/comm.hpp"
 
 #include "s4u/storage.hpp"
 #include "s4u/comm.hpp"
 
 #include "s4u/storage.hpp"
similarity index 51%
rename from include/simgrid/s4u/async.hpp
rename to include/simgrid/s4u/Activity.hpp
index 2f12e79..533a92d 100644 (file)
@@ -4,8 +4,8 @@
 /* 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. */
 
 /* 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. */
 
-#ifndef SIMGRID_S4U_ASYNC_HPP
-#define SIMGRID_S4U_ASYNC_HPP
+#ifndef SIMGRID_S4U_ACTIVITY_HPP
+#define SIMGRID_S4U_ACTIVITY_HPP
 
 #include <stdlib.h>
 #include <xbt/base.h>
 
 #include <stdlib.h>
 #include <xbt/base.h>
 SG_BEGIN_DECL();
 typedef enum {
   inited, started, finished
 SG_BEGIN_DECL();
 typedef enum {
   inited, started, finished
-} e_s4u_async_state_t;
+} e_s4u_activity_state_t;
 SG_END_DECL();
 
 namespace simgrid {
 namespace s4u {
 
 SG_END_DECL();
 
 namespace simgrid {
 namespace s4u {
 
-/** @brief Asynchronous Actions
+/** @brief Activities
  *
  *
- * This class is the ancestor of every asynchronous actions, that is, of actions that do take time in the simulated world.
+ * 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 Async {
+XBT_PUBLIC_CLASS Activity {
   friend Comm;
 protected:
   friend Comm;
 protected:
-  Async();
-  virtual ~Async();
+  Activity();
+  virtual ~Activity();
   
 private:
   simgrid::simix::Synchro *pimpl_ = NULL;
 
 private:
   
 private:
   simgrid::simix::Synchro *pimpl_ = NULL;
 
 private:
-  e_s4u_async_state_t state_ = inited;
+  e_s4u_activity_state_t state_ = inited;
 public:
 public:
-  /** Starts a previously created async.
+  /** Starts a previously created activity.
    *
    * This function is optional: you can call wait() even if you didn't call start()
    */
   virtual void start()=0;
    *
    * This function is optional: you can call wait() even if you didn't call start()
    */
   virtual void start()=0;
-  /** Tests whether the given async is terminated yet */
+  /** Tests whether the given activity is terminated yet. This is a pure function. */
   //virtual bool test()=0;
   //virtual bool test()=0;
-  /** Blocks until the async is terminated */
+  /** Blocks until the activity is terminated */
   virtual void wait()=0;
   virtual void wait()=0;
-  /** Blocks until the async is terminated, or until the timeout is elapsed
+  /** Blocks until the activity is terminated, or until the timeout is elapsed
    *  Raises: timeout exception.*/
   virtual void wait(double timeout)=0;
    *  Raises: timeout exception.*/
   virtual void wait(double timeout)=0;
-  /** Cancel that async */
+  /** Cancel that activity */
   //virtual void cancel();
   //virtual void cancel();
-  /** Retrieve the current state of the async */
-  e_s4u_async_state_t getState() {return state_;}
+  /** Retrieve the current state of the activity */
+  e_s4u_activity_state_t getState() {return state_;}
 
 private:
   double remains_ = 0;
 public:
 
 private:
   double remains_ = 0;
 public:
-  /** Get the remaining amount of work that this Async entails. When it's 0, it's done. */
+  /** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
   double getRemains();
   double getRemains();
-  /** Set the [remaining] amount of work that this Async will entail
+  /** Set the [remaining] amount of work that this Activity will entail
    *
    *
-   * It is forbidden to change the amount of work once the Async is started */
+   * It is forbidden to change the amount of work once the Activity is started */
   void setRemains(double remains);
 
 private:
   void *userData_ = NULL;
 public:
   void setRemains(double remains);
 
 private:
   void *userData_ = NULL;
 public:
-  /** Put some user data onto the Async */
+  /** Put some user data onto the Activity */
   void setUserData(void *data) {userData_=data;}
   void setUserData(void *data) {userData_=data;}
-  /** Retrieve the user data of the Async */
+  /** Retrieve the user data of the Activity */
   void *getUserData() { return userData_; }
 }; // class
 
 }}; // Namespace simgrid::s4u
 
   void *getUserData() { return userData_; }
 }; // class
 
 }}; // Namespace simgrid::s4u
 
-#endif /* SIMGRID_S4U_ASYNC_HPP */
+#endif /* SIMGRID_S4U_ACTIVITY_HPP */
index b56e272..c9d615c 100644 (file)
@@ -8,8 +8,8 @@
 #define SIMGRID_S4U_COMM_HPP
 
 #include <xbt/base.h>
 #define SIMGRID_S4U_COMM_HPP
 
 #include <xbt/base.h>
+#include <simgrid/s4u/Activity.hpp>
 #include <simgrid/s4u/forward.hpp>
 #include <simgrid/s4u/forward.hpp>
-#include <simgrid/s4u/async.hpp>
 #include <simgrid/s4u/mailbox.hpp>
 
 namespace simgrid {
 #include <simgrid/s4u/mailbox.hpp>
 
 namespace simgrid {
@@ -19,8 +19,8 @@ namespace s4u {
  *
  * Represents all asynchronous communications, that you can test or wait onto.
  */
  *
  * Represents all asynchronous communications, that you can test or wait onto.
  */
-XBT_PUBLIC_CLASS Comm : public Async {
-  Comm() : Async() {}
+XBT_PUBLIC_CLASS Comm : public Activity {
+  Comm() : Activity() {}
 public:
   virtual ~Comm();
 
 public:
   virtual ~Comm();
 
index 12a7894..b8f6b42 100644 (file)
@@ -9,7 +9,7 @@
 namespace simgrid {
 namespace s4u {
 
 namespace simgrid {
 namespace s4u {
 
-class Async;
+class Activity;
 class Comm;
 class Engine;
 class Host;
 class Comm;
 class Engine;
 class Host;
similarity index 65%
rename from src/s4u/s4u_async.cpp
rename to src/s4u/s4u_activity.cpp
index bf2f951..c49e2c4 100644 (file)
@@ -7,21 +7,21 @@
 #include "xbt/log.h"
 #include "src/msg/msg_private.h"
 
 #include "xbt/log.h"
 #include "src/msg/msg_private.h"
 
-#include "simgrid/s4u/async.hpp"
+#include "simgrid/s4u/Activity.hpp"
 
 XBT_LOG_EXTERNAL_CATEGORY(s4u);
 
 XBT_LOG_EXTERNAL_CATEGORY(s4u);
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_async,s4u,"S4U asynchronous actions");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_activity,s4u,"S4U activities");
 using namespace simgrid;
 
 using namespace simgrid;
 
-s4u::Async::Async() {
+s4u::Activity::Activity() {
 
 }
 
 }
-s4u::Async::~Async() {
+s4u::Activity::~Activity() {
 
 }
 
 
 }
 
-void s4u::Async::setRemains(double remains) {
-  xbt_assert(state_ == inited, "Cannot change the remaining amount of work once the Async is started");
+void s4u::Activity::setRemains(double remains) {
+  xbt_assert(state_ == inited, "Cannot change the remaining amount of work once the Activity is started");
   remains_ = remains;
 }
 
   remains_ = remains;
 }
 
index 1415742..fb272f4 100644 (file)
@@ -9,7 +9,7 @@
 
 #include "simgrid/s4u/comm.hpp"
 
 
 #include "simgrid/s4u/comm.hpp"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_comm,s4u_async,"S4U asynchronous communications");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_comm,s4u_activity,"S4U asynchronous communications");
 using namespace simgrid;
 
 s4u::Comm::~Comm() {
 using namespace simgrid;
 
 s4u::Comm::~Comm() {
index 2a9c547..61bd33b 100644 (file)
@@ -372,7 +372,7 @@ endif()
 set(S4U_SRC
   src/s4u/s4u_actor.cpp
   src/s4u/s4u_as.cpp
 set(S4U_SRC
   src/s4u/s4u_actor.cpp
   src/s4u/s4u_as.cpp
-  src/s4u/s4u_async.cpp
+  src/s4u/s4u_activity.cpp
   src/s4u/s4u_comm.cpp
   src/s4u/s4u_engine.cpp  
   src/s4u/s4u_file.cpp  
   src/s4u/s4u_comm.cpp
   src/s4u/s4u_engine.cpp  
   src/s4u/s4u_file.cpp  
@@ -634,7 +634,7 @@ set(headers_to_install
   include/simgrid/s4u/forward.hpp
   include/simgrid/s4u/actor.hpp
   include/simgrid/s4u/As.hpp
   include/simgrid/s4u/forward.hpp
   include/simgrid/s4u/actor.hpp
   include/simgrid/s4u/As.hpp
-  include/simgrid/s4u/async.hpp
+  include/simgrid/s4u/Activity.hpp
   include/simgrid/s4u/comm.hpp
   include/simgrid/s4u/engine.hpp  
   include/simgrid/s4u/file.hpp  
   include/simgrid/s4u/comm.hpp
   include/simgrid/s4u/engine.hpp  
   include/simgrid/s4u/file.hpp