#include <utility>
#include <vector>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Simulation engine
*
* This is a singleton containing all the main functions of the simulation.
~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;
/** @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 <s4u_ex_actors_create>`. @endverbatim */
template <class F> void register_actor(const std::string& name)
{
- kernel::actor::ActorCodeFactory code_factory = [](std::vector<std::string> args) {
- return kernel::actor::ActorCode([args = std::move(args)]() mutable {
+ kernel::actor::ActorCodeFactory code_factory = [](std::vector<std::string> args_factory) {
+ return kernel::actor::ActorCode([args = std::move(args_factory)]() mutable {
F code(std::move(args));
code();
});
/** @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 <s4u_ex_actors_create>`. @endverbatim */
template <class F> void register_actor(const std::string& name, F code)
{
- kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args) {
- return kernel::actor::ActorCode([code, args = std::move(args)]() mutable { code(std::move(args)); });
+ kernel::actor::ActorCodeFactory code_factory = [code](std::vector<std::string> args_factory) {
+ return kernel::actor::ActorCode([code, args = std::move(args_factory)]() mutable { code(std::move(args)); });
};
register_function(name, code_factory);
}
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<ActorPtr> get_all_actors() const;
/** @brief Retrieves all netzones of the type indicated by the template argument */
template <class T> std::vector<T*> get_filtered_netzones() const
{
- static_assert(std::is_base_of<kernel::routing::NetZoneImpl, T>::value,
+ static_assert(std::is_base_of_v<kernel::routing::NetZoneImpl, T>,
"Filtering netzones is only possible for subclasses of kernel::routing::NetZoneImpl");
std::vector<T*> res;
get_filtered_netzones_recursive(get_netzone_root(), &res);
/** @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
*
template <class T>
XBT_PRIVATE void get_filtered_netzones_recursive(const s4u::NetZone* current, std::vector<T*>* whereto)
{
- static_assert(std::is_base_of<kernel::routing::NetZoneImpl, T>::value,
+ static_assert(std::is_base_of_v<kernel::routing::NetZoneImpl, T>,
"Filtering netzones is only possible for subclasses of kernel::routing::NetZoneImpl");
for (auto const& elem : current->get_children()) {
get_filtered_netzones_recursive(elem, whereto);
}
}
#endif
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_ENGINE_HPP */