X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4bb73cb3914b5f7b77a9ec1f8abe728e637cc016..24de4abff1dbfc7c779f6768186be603342df002:/include/simgrid/s4u/Actor.hpp diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index b4cdc75136..efdc1bd822 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -51,7 +51,7 @@ namespace s4u { * pure function or as an object. It is very simple with functions: * * @code{.cpp} - * #include "s4u/actor.hpp" + * #include * * // Declare the code of your worker * void worker() { @@ -69,7 +69,7 @@ namespace s4u { * The syntax is slightly more complicated, but not much. * * @code{.cpp} - * #include "s4u/actor.hpp" + * #include * * // Declare the class representing your actors * class Worker { @@ -129,13 +129,12 @@ namespace s4u { */ /** @brief Simulation Agent */ -XBT_PUBLIC_CLASS Actor : public simgrid::xbt::Extendable -{ +class XBT_PUBLIC Actor : public simgrid::xbt::Extendable { friend Exec; friend Mailbox; - friend simgrid::simix::ActorImpl; + friend simgrid::kernel::actor::ActorImpl; friend simgrid::kernel::activity::MailboxImpl; - simix::ActorImpl* pimpl_ = nullptr; + kernel::actor::ActorImpl* pimpl_ = nullptr; /** Wrap a (possibly non-copyable) single-use task into a `std::function` */ template @@ -207,19 +206,25 @@ public: /** Returns whether or not this actor has been daemonized or not **/ bool isDaemon(); + XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_name()") const simgrid::xbt::string& getName() const + { + return get_name(); + } + XBT_ATTRIB_DEPRECATED_v323("Please use Actor::get_cname()") const char* getCname() const { return get_cname(); } + /** Retrieves the name of that actor as a C++ string */ - const simgrid::xbt::string& getName() const; + const simgrid::xbt::string& get_name() const; /** Retrieves the name of that actor as a C string */ - const char* getCname() const; + const char* get_cname() const; /** Retrieves the host on which that actor is running */ s4u::Host* getHost(); /** Retrieves the PID of that actor * - * actor_id_t is an alias for unsigned long */ + * aid_t is an alias for long */ aid_t getPid(); /** Retrieves the PPID of that actor * - * actor_id_t is an alias for unsigned long */ + * aid_t is an alias for long */ aid_t getPpid(); /** Suspend an actor by suspending the task on which it was waiting for the completion. */ @@ -227,9 +232,9 @@ public: /** Resume a suspended actor by resuming the task on which it was waiting for the completion. */ void resume(); - + void yield(); - + /** Returns true if the actor is suspended. */ int isSuspended(); @@ -277,7 +282,7 @@ public: static void killAll(int resetPid); /** Returns the internal implementation of this actor */ - simix::ActorImpl* getImpl(); + kernel::actor::ActorImpl* getImpl(); /** Retrieve the property value (or nullptr if not set) */ std::map* getProperties(); @@ -308,12 +313,6 @@ template inline void sleep_until(const SimulationTimePoint