X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/28576ce34587a14772cd232febbc64902cf1ef19..8052f28d5b5a9d88b6724dff2e5e81dee10065d7:/include/simgrid/s4u/Engine.hpp diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index 94b0202dfc..fbef8cccc9 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; @@ -56,6 +52,7 @@ public: static s4u::Engine* get_instance(); static s4u::Engine* get_instance(int* argc, char** argv); static bool has_instance() { return instance_ != nullptr; } + const std::vector& get_cmdline() const; /** * Creates a new platform, including hosts, links, and the routing table. @@ -158,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; @@ -192,21 +190,24 @@ 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); return res; } - kernel::EngineImpl* get_impl() const { return pimpl; } + kernel::EngineImpl* get_impl() const + { + return pimpl_; + } /** Returns whether SimGrid was initialized yet -- mostly for internal use */ static bool is_initialized(); /** @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 * @@ -255,19 +256,20 @@ private: static xbt::signal on_deadlock; static xbt::signal on_simulation_end; - kernel::EngineImpl* const pimpl; + kernel::EngineImpl* const pimpl_; static Engine* instance_; void initialize(int* argc, char** argv); }; 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); @@ -277,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 */