X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/64cc1c2a72ee1ea9e69ac9c2440b33676e80db25..22e6546d2c6f14864cc93c4ed1470d8e8c1e2d95:/include/simgrid/s4u/Actor.hpp diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index eef1611123..facaf0a59e 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -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. */ @@ -197,10 +197,10 @@ public: /** This actor will be automatically terminated when the last non-daemon process finishes **/ void daemonize(); - /** Retrieves the name of that actor as a C string */ - const char* getCname(); /** Retrieves the name of that actor as a C++ string */ - simgrid::xbt::string getName(); + const simgrid::xbt::string& getName() const; + /** Retrieves the name of that actor as a C string */ + const char* getCname() const; /** Retrieves the host on which that actor is running */ s4u::Host* getHost(); /** Retrieves the PID of that actor @@ -286,22 +286,25 @@ template inline void sleep_for(std::chrono::duration(duration); this_actor::sleep_for(seconds.count()); - } - template - inline void sleep_until(const SimulationTimePoint& timeout_time) - { - auto timeout_native = std::chrono::time_point_cast(timeout_time); - this_actor::sleep_until(timeout_native.time_since_epoch().count()); - } +} - XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into an error.") inline void sleep( - double duration) - { - return sleep_for(duration); - } +template inline void sleep_until(const SimulationTimePoint& timeout_time) +{ + auto timeout_native = std::chrono::time_point_cast(timeout_time); + this_actor::sleep_until(timeout_native.time_since_epoch().count()); +} + +XBT_ATTRIB_DEPRECATED_v320("Use sleep_for(): v3.20 will turn this warning into an error.") inline void sleep( + double duration) +{ + return sleep_for(duration); +} + +/** Block the actor, computing the given amount of flops */ +XBT_PUBLIC(void) execute(double flop); - /** Block the actor, computing the given amount of flops */ - XBT_PUBLIC(void) execute(double flop); + /** Block the actor, computing the given amount of flops and priority */ + XBT_PUBLIC(void) execute(double flop, double priority); /** Block the actor until it gets a message from the given mailbox. * @@ -327,39 +330,42 @@ template inline void sleep_for(std::chrono::duration