X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/65beede857f93e33c96e544f76b93793c973dc10..a4c8f1898670317d0fa33bf1b1a904ea922b78cc:/include/simgrid/s4u/Actor.hpp diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index a089020e60..3b847f249f 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -6,15 +6,18 @@ #ifndef SIMGRID_S4U_ACTOR_HPP #define SIMGRID_S4U_ACTOR_HPP -#include -#include // deprecated wrappers +#include + #include -#include #include #include #include #include +#include +#include // deprecated wrappers +#include + namespace simgrid { namespace s4u { @@ -139,10 +142,11 @@ public: // ***** 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 */ - static ActorPtr self(); + static Actor* self(); /** Signal to others that a new actor has been created **/ static xbt::signal on_creation; @@ -289,9 +293,9 @@ public: kernel::actor::ActorImpl* get_impl() const { return pimpl_; } /** Retrieve the property value (or nullptr if not set) */ - std::unordered_map* - get_properties(); // FIXME: do not export the map, but only the keys or something - const char* get_property(const std::string& key); + const std::unordered_map* + get_properties() const; // FIXME: do not export the map, but only the keys or something + const char* get_property(const std::string& key) const; void set_property(const std::string& key, const std::string& value); #ifndef DOXYGEN @@ -308,10 +312,10 @@ namespace this_actor { 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 inline void sleep_for(std::chrono::duration duration) { @@ -319,9 +323,9 @@ template inline void sleep_for(std::chrono::duration inline void sleep_until(const SimulationTimePoint& timeout_time) +template inline void sleep_until(const SimulationTimePoint& wakeup_time) { - auto timeout_native = std::chrono::time_point_cast(timeout_time); + auto timeout_native = std::chrono::time_point_cast(wakeup_time); this_actor::sleep_until(timeout_native.time_since_epoch().count()); } @@ -461,9 +465,6 @@ XBT_PUBLIC void migrate(Host* new_host); #ifndef DOXYGEN XBT_ATTRIB_DEPRECATED_v325("Please use std::function for first parameter.") XBT_PUBLIC void on_exit(const std::function& fun, void* data); - -/** @deprecated See this_actor::exit() */ -XBT_ATTRIB_DEPRECATED_v324("Please use this_actor::exit()") XBT_PUBLIC void kill(); #endif }