Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Factor code to get and resize temporary shared mem regions in smpi.
[simgrid.git] / src / msg / msg_private.hpp
index db817a6..505c892 100644 (file)
 #include "simgrid/msg.h"
 #include "src/kernel/activity/CommImpl.hpp"
 #include <simgrid/modelchecker.h>
+#include <xbt/Extendable.hpp>
 
 #include <cmath>
 
 /**************** datatypes **********************************/
 namespace simgrid {
 namespace msg {
-class Task {
+class Task : public xbt::Extendable<Task> {
   std::string name_             = "";
   std::string tracing_category_ = "";
-  void* userdata_               = nullptr;
   long long int id_;
 
   double timeout_  = 0.0;
@@ -59,8 +59,8 @@ public:
   void set_tracing_category(const char* category) { tracing_category_ = category ? std::string(category) : ""; }
   const std::string& get_tracing_category() { return tracing_category_; }
   bool has_tracing_category() { return not tracing_category_.empty(); }
-  void* get_user_data() { return userdata_; }
-  void set_user_data(void* data) { userdata_ = data; }
+  XBT_ATTRIB_DEPRECATED_v329("Please use set_data()") void* get_user_data() { return get_data(); }
+  XBT_ATTRIB_DEPRECATED_v329("Please use get_data()") void set_user_data(void* data) { set_data(data); }
   long long int get_id() { return id_; }
   double get_priority() { return priority_; }
   void set_priority(double priority);
@@ -101,31 +101,19 @@ public:
   msg_error_t get_status() { return status_; }
 };
 
-class ActorUserData {
-  void* userdata_      = nullptr;
-
-public:
-  static xbt::Extension<simgrid::s4u::Actor, ActorUserData> EXTENSION_ID;
-
-  void set_user_data(void* data) { userdata_ = data; }
-  void* get_user_data() { return userdata_; }
-};
-
 } // namespace msg
 } // namespace simgrid
 
 /************************** Global variables ********************************/
-struct s_MSG_Global_t {
-  bool debug_multiple_use;           /* whether we want an error message when reusing the same Task for 2 things */
+struct MSG_Global_t {
+  static bool debug_multiple_use;    /* whether we want an error message when reusing the same Task for 2 things */
   std::atomic_int_fast32_t sent_msg; /* Total amount of messages sent during the simulation */
   void (*task_copy_callback)(msg_task_t task, msg_process_t src, msg_process_t dst);
   void_f_pvoid_t process_data_cleanup;
 };
-typedef s_MSG_Global_t* MSG_Global_t;
 
-XBT_PUBLIC_DATA MSG_Global_t msg_global;
+XBT_PUBLIC_DATA MSG_Global_t* msg_global;
 
 /*************************************************************/
-XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size);
 
 #endif