X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7b50ef668fe46e44363e4c7ea2089e37c6afec38..3f9b311ec56db95ec539001a860ae3c838c48312:/include/simgrid/s4u/Engine.hpp diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index c9fd4754f4..2bdb4a9cce 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -18,8 +18,7 @@ #include #include -namespace simgrid { -namespace s4u { +namespace simgrid::s4u { /** @brief Simulation engine * * This is a singleton containing all the main functions of the simulation. @@ -41,9 +40,6 @@ public: ~Engine(); #endif - /** Finalize the default engine and all its dependencies */ - XBT_ATTRIB_DEPRECATED_v335("Users are not supposed to shutdown the Engine") void shutdown(); - /** Run the simulation until its end */ void run() const; @@ -97,8 +93,8 @@ public: /** @verbatim embed:rst:inline Bind an actor name that could be found in :ref:`pf_tag_actor` tag to a class name passed as a template parameter. See the :ref:`example `. @endverbatim */ template void register_actor(const std::string& name) { - kernel::actor::ActorCodeFactory code_factory = [](std::vector args) { - return kernel::actor::ActorCode([args = std::move(args)]() mutable { + kernel::actor::ActorCodeFactory code_factory = [](std::vector args_factory) { + return kernel::actor::ActorCode([args = std::move(args_factory)]() mutable { F code(std::move(args)); code(); }); @@ -108,8 +104,8 @@ public: /** @verbatim embed:rst:inline Bind an actor name that could be found in :ref:`pf_tag_actor` tag to a function name passed as a parameter. See the :ref:`example `. @endverbatim */ template void register_actor(const std::string& name, F code) { - kernel::actor::ActorCodeFactory code_factory = [code](std::vector args) { - return kernel::actor::ActorCode([code, args = std::move(args)]() mutable { code(std::move(args)); }); + kernel::actor::ActorCodeFactory code_factory = [code](std::vector args_factory) { + return kernel::actor::ActorCode([code, args = std::move(args_factory)]() mutable { code(std::move(args)); }); }; register_function(name, code_factory); } @@ -159,6 +155,7 @@ public: Link* link_by_name_or_null(const std::string& name) const; Mailbox* mailbox_by_name_or_create(const std::string& name) const; + MessageQueue* message_queue_by_name_or_create(const std::string& name) const; size_t get_actor_count() const; std::vector get_all_actors() const; @@ -193,7 +190,7 @@ public: /** @brief Retrieves all netzones of the type indicated by the template argument */ template std::vector get_filtered_netzones() const { - static_assert(std::is_base_of::value, + static_assert(std::is_base_of_v, "Filtering netzones is only possible for subclasses of kernel::routing::NetZoneImpl"); std::vector res; get_filtered_netzones_recursive(get_netzone_root(), &res); @@ -210,7 +207,7 @@ public: /** @brief set a configuration variable * * @beginrst - * Do --help on any simgrid binary to see the list of currently existing configuration variables + * Do --help on any SimGrid binary to see the list of currently existing configuration variables * (see also :ref:`options`). * @endrst * @@ -266,12 +263,13 @@ private: std::vector create_DAG_from_dot(const std::string& filename); std::vector create_DAG_from_DAX(const std::string& filename); +std::vector create_DAG_from_json(const std::string& filename); #ifndef DOXYGEN /* Internal use only, no need to expose it */ template XBT_PRIVATE void get_filtered_netzones_recursive(const s4u::NetZone* current, std::vector* whereto) { - static_assert(std::is_base_of::value, + static_assert(std::is_base_of_v, "Filtering netzones is only possible for subclasses of kernel::routing::NetZoneImpl"); for (auto const& elem : current->get_children()) { get_filtered_netzones_recursive(elem, whereto); @@ -281,7 +279,6 @@ XBT_PRIVATE void get_filtered_netzones_recursive(const s4u::NetZone* current, st } } #endif -} // namespace s4u -} // namespace simgrid +} // namespace simgrid::s4u #endif /* SIMGRID_S4U_ENGINE_HPP */