#ifndef SIMGRID_S4U_ACTOR_HPP
#define SIMGRID_S4U_ACTOR_HPP
-#include <functional>
-#include <map> // deprecated wrappers
+#include <simgrid/forward.h>
+
#include <simgrid/chrono.hpp>
-#include <unordered_map>
#include <xbt/Extendable.hpp>
#include <xbt/functional.hpp>
#include <xbt/signal.hpp>
#include <xbt/string.hpp>
+#include <functional>
+#include <map> // deprecated wrappers
+#include <unordered_map>
+
namespace simgrid {
namespace s4u {
// ***** Reference count *****
friend XBT_PUBLIC void intrusive_ptr_add_ref(Actor * actor);
friend XBT_PUBLIC void intrusive_ptr_release(Actor * actor);
+ int get_refcount();
// ***** Actor creation *****
/** Retrieve a reference to myself */
XBT_PUBLIC bool is_maestro();
-/** Block the current actor sleeping for that amount of seconds (may throw hostFailure) */
+/** Block the current actor sleeping for that amount of seconds */
XBT_PUBLIC void sleep_for(double duration);
-/** Block the current actor sleeping until the specified timestamp (may throw hostFailure) */
-XBT_PUBLIC void sleep_until(double timeout);
+/** Block the current actor sleeping until the specified timestamp */
+XBT_PUBLIC void sleep_until(double wakeup_time);
template <class Rep, class Period> inline void sleep_for(std::chrono::duration<Rep, Period> duration)
{
this_actor::sleep_for(seconds.count());
}
-template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& timeout_time)
+template <class Duration> inline void sleep_until(const SimulationTimePoint<Duration>& wakeup_time)
{
- auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(timeout_time);
+ auto timeout_native = std::chrono::time_point_cast<SimulationClockDuration>(wakeup_time);
this_actor::sleep_until(timeout_native.time_since_epoch().count());
}
#ifndef DOXYGEN
XBT_ATTRIB_DEPRECATED_v325("Please use std::function<void(bool)> for first parameter.") XBT_PUBLIC
void on_exit(const std::function<void(int, void*)>& fun, void* data);
-
-/** @deprecated See this_actor::exit() */
-XBT_ATTRIB_DEPRECATED_v324("Please use this_actor::exit()") XBT_PUBLIC void kill();
#endif
}