Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve deprecate messages: we know when to remove it
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 13 Jul 2017 16:04:45 +0000 (18:04 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 13 Jul 2017 21:45:46 +0000 (23:45 +0200)
include/simgrid/msg.h
include/simgrid/s4u/Actor.hpp
include/simgrid/s4u/Comm.hpp
include/simgrid/s4u/ConditionVariable.hpp
include/xbt/base.h

index 3991f2b..d143c3f 100644 (file)
@@ -170,34 +170,48 @@ XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char*
 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
 
 /* Deprecated forms of the previous functions */
 XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
 
 /* Deprecated forms of the previous functions */
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_root since v3.16")
-    msg_netzone_t MSG_environment_get_routing_root() {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_root() instead: v3.19 will remove MSG_environment_get_routing_root() completely.") msg_netzone_t
+    MSG_environment_get_routing_root()
+{
   return MSG_zone_get_root();
 }
   return MSG_zone_get_root();
 }
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_name since v3.16")
-    const char* MSG_environment_as_get_name(msg_netzone_t zone) {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_name() instead: v3.19 will remove MSG_environment_as_get_name() completely.") const
+    char* MSG_environment_as_get_name(msg_netzone_t zone)
+{
   return MSG_zone_get_name(zone);
 }
   return MSG_zone_get_name(zone);
 }
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_by_name since v3.16")
-    msg_netzone_t MSG_environment_as_get_by_name(const char* name) {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_by_name() instead: v3.19 will remove MSG_environment_as_get_by_name() completely.") msg_netzone_t
+    MSG_environment_as_get_by_name(const char* name)
+{
   return MSG_zone_get_by_name(name);
 }
   return MSG_zone_get_by_name(name);
 }
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_sons since v3.16")
-    xbt_dict_t MSG_environment_as_get_routing_sons(msg_netzone_t zone) {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_sons() instead: v3.19 will remove MSG_environment_as_get_routing_sons() completely.") xbt_dict_t
+    MSG_environment_as_get_routing_sons(msg_netzone_t zone)
+{
   xbt_dict_t res = xbt_dict_new_homogeneous(NULL);
   MSG_zone_get_sons(zone, res);
   return res;
 }
   xbt_dict_t res = xbt_dict_new_homogeneous(NULL);
   MSG_zone_get_sons(zone, res);
   return res;
 }
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_property_value since v3.16")
-    const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name) {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_property_value() instead: v3.19 will remove MSG_environment_as_get_property_value() completely.")
+    const char* MSG_environment_as_get_property_value(msg_netzone_t zone, const char* name)
+{
   return MSG_zone_get_property_value(zone, name);
 }
   return MSG_zone_get_property_value(zone, name);
 }
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_set_property_value since v3.16")
-    void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value) {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_set_property_value() instead: v3.19 will remove MSG_environment_as_set_property_value() "
+    "completely.") void MSG_environment_as_set_property_value(msg_netzone_t zone, const char* name, char* value)
+{
   MSG_zone_set_property_value(zone, name, value);
 }
   MSG_zone_set_property_value(zone, name, value);
 }
-static inline XBT_ATTRIB_DEPRECATED("Please use MSG_zone_get_hosts since v3.16")
-    xbt_dynar_t MSG_environment_as_get_hosts(msg_netzone_t zone) {
+static inline XBT_ATTRIB_DEPRECATED_v319(
+    "Use MSG_zone_get_hosts() instead: v3.19 will remove MSG_environment_as_get_hosts() completely.") xbt_dynar_t
+    MSG_environment_as_get_hosts(msg_netzone_t zone)
+{
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL);
   MSG_zone_get_hosts(zone, res);
   return res;
   xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL);
   MSG_zone_get_hosts(zone, res);
   return res;
index 4d94896..99ede18 100644 (file)
@@ -293,8 +293,7 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
     this_actor::sleep_until(timeout_native.time_since_epoch().count());
   }
 
     this_actor::sleep_until(timeout_native.time_since_epoch().count());
   }
 
-  XBT_ATTRIB_DEPRECATED("Use sleep_for()")
-  inline void sleep(double duration)
+  XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will drop sleep() completely.") inline void sleep(double duration)
   {
     return sleep_for(duration);
   }
   {
     return sleep_for(duration);
   }
@@ -306,23 +305,29 @@ template <class Rep, class Period> inline void sleep_for(std::chrono::duration<R
    *
    * See \ref Comm for the full communication API (including non blocking communications).
    */
    *
    * See \ref Comm for the full communication API (including non blocking communications).
    */
-  XBT_PUBLIC(void*) XBT_ATTRIB_DEPRECATED("Please use Mailbox::get") recv(MailboxPtr chan);                 // 3.17
-  XBT_PUBLIC(void*) XBT_ATTRIB_DEPRECATED("Please use Mailbox::get") recv(MailboxPtr chan, double timeout); // 3.17
+  XBT_PUBLIC(void*)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will remove Actor::recv() completely.") recv(MailboxPtr chan);
+  XBT_PUBLIC(void*)
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get(): v3.20 will remove Actor::recv() completely.")
+      recv(MailboxPtr chan, double timeout);
   XBT_PUBLIC(CommPtr)
   XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::recv_async") irecv(MailboxPtr chan, void** data); // 3.17
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::recv_async(): v3.20 will remove Actor::irecv() completely.")
+      irecv(MailboxPtr chan, void** data);
 
   /** Block the actor until it delivers a message of the given simulated size to the given mailbox
    *
    * See \ref Comm for the full communication API (including non blocking communications).
   */
   XBT_PUBLIC(void)
 
   /** Block the actor until it delivers a message of the given simulated size to the given mailbox
    *
    * See \ref Comm for the full communication API (including non blocking communications).
   */
   XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::put") send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will remove Actor::send() completely.")
+      send(MailboxPtr chan, void* payload, double simulatedSize); // 3.17
   XBT_PUBLIC(void)
   XBT_PUBLIC(void)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::put")
-  send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put(): v3.20 will remove Actor::send() completely.")
+      send(MailboxPtr chan, void* payload, double simulatedSize, double timeout); // 3.17
 
   XBT_PUBLIC(CommPtr)
 
   XBT_PUBLIC(CommPtr)
-  XBT_ATTRIB_DEPRECATED("Please use Mailbox::put_async") isend(MailboxPtr chan, void* payload, double simulatedSize);
+  XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_async(): v3.20 will remove Actor::isend() completely.")
+      isend(MailboxPtr chan, void* payload, double simulatedSize);
 
   /** @brief Returns the actor ID of the current actor (same as pid). */
   XBT_PUBLIC(aid_t) getPid();
 
   /** @brief Returns the actor ID of the current actor (same as pid). */
   XBT_PUBLIC(aid_t) getPid();
index 369b718..c1b27c9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2017. 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. */
 
 /* 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. */
@@ -10,7 +10,7 @@
 
 #include <simgrid/forward.h>
 #include <simgrid/s4u/Activity.hpp>
 
 #include <simgrid/forward.h>
 #include <simgrid/s4u/Activity.hpp>
-#include <simgrid/s4u/Mailbox.hpp> // DEPRECATED 3.17
+#include <simgrid/s4u/Mailbox.hpp> // DEPRECATED 3.20
 #include <simgrid/s4u/forward.hpp>
 
 #include <vector>
 #include <simgrid/s4u/forward.hpp>
 
 #include <vector>
@@ -55,31 +55,33 @@ public:
     return idx;
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
     return idx;
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_init") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.")
       send_init(MailboxPtr dest)
   {
     return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
       send_init(MailboxPtr dest)
   {
     return dest->put_init();
   }
   /** Creates (but don't start) an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_init") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::put_init(): v3.20 will remove Comm::send_init() completely.")
       send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
       send_init(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_init(data, simulatedByteAmount);
   }
   /** Creates and start an async send to the mailbox @p dest */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::put_async") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320(
+      "Use Mailbox::put_async(): v3.20 will remove Comm::send_async() completely.")
       send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
       send_async(MailboxPtr dest, void* data, int simulatedByteAmount)
   {
     return dest->put_async(data, simulatedByteAmount);
   }
   /** Creates (but don't start) an async recv onto the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::get_init") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320("Use Mailbox::get_init(): v3.20 will remove Comm::recv_init() completely.")
       recv_init(MailboxPtr from)
   {
     return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
       recv_init(MailboxPtr from)
   {
     return from->get_init();
   }
   /** Creates and start an async recv to the mailbox @p from */
-  static CommPtr XBT_ATTRIB_DEPRECATED("please use Mailbox::get_async") // 3.17
+  static CommPtr XBT_ATTRIB_DEPRECATED_v320(
+      "Use Mailbox::get_async(): v3.20 will remove Comm::recv_async() completely.")
       recv_async(MailboxPtr from, void** data)
   {
     return from->get_async(data);
       recv_async(MailboxPtr from, void** data)
   {
     return from->get_async(data);
index b1e2be3..c40482f 100644 (file)
@@ -104,8 +104,7 @@ public:
   void notify_one();
   void notify_all();
 
   void notify_one();
   void notify_all();
 
-  XBT_ATTRIB_DEPRECATED("Use notify_one() instead")
-  void notify() { notify_one(); }
+  XBT_ATTRIB_DEPRECATED_v319("Use notify_one(): v3.19 will remove notify() completely.") void notify() { notify_one(); }
 };
 
 using ConditionVariablePtr = ConditionVariable::Ptr;
 };
 
 using ConditionVariablePtr = ConditionVariable::Ptr;
index ba5e76f..e2d740c 100644 (file)
@@ -1,6 +1,6 @@
 /* xbt.h - Public interface to the xbt (simgrid's toolbox)                  */
 
 /* xbt.h - Public interface to the xbt (simgrid's toolbox)                  */
 
-/* Copyright (c) 2004-2015. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2017. 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. */
 
 /* 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. */
@@ -47,7 +47,8 @@
 
 #define XBT_ATTRIB_NORETURN __attribute__((noreturn))
 #define XBT_ATTRIB_UNUSED  __attribute__((unused))
 
 #define XBT_ATTRIB_NORETURN __attribute__((noreturn))
 #define XBT_ATTRIB_UNUSED  __attribute__((unused))
-#define XBT_ATTRIB_DEPRECATED(m)  __attribute__((deprecated(m)))
+#define XBT_ATTRIB_DEPRECATED_v319(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.19 */
+#define XBT_ATTRIB_DEPRECATED_v320(msg) __attribute__((deprecated(msg))) /* Will be dropped in v3.20 */
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */
 
 /* Constructor priorities exist since gcc 4.3.  Apparently, they are however not
  * supported on Macs. */