-/* Copyright (c) 2018-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2018-2020. 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. */
.def_property("pstate", &Host::get_pstate, &Host::set_pstate, "The current pstate")
.def("current", &Host::current, "Retrieves the host on which the running actor is located, see :cpp:func:`simgrid::s4u::Host::current()`")
- .def_property_readonly("name", [](Host* self) -> const std::string {
+ .def_property_readonly("name", [](const Host* self) -> const std::string {
return std::string(self->get_name().c_str()); // Convert from xbt::string because of MC
}, "The name of this host")
.def_property_readonly("load", &Host::get_load,
/* Class Mailbox */
py::class_<simgrid::s4u::Mailbox, std::unique_ptr<Mailbox, py::nodelete>>(m, "Mailbox", "Mailbox, see :ref:`class s4u::Mailbox <API_s4u_Mailbox>`")
- .def("__str__", [](Mailbox* self) -> const std::string {
+ .def("__str__", [](const Mailbox* self) -> const std::string {
return std::string("Mailbox(") + self->get_cname() + ")";
}, "Textual representation of the Mailbox`")
.def("by_name", &Mailbox::by_name, "Retrieve a Mailbox from its name, see :cpp:func:`simgrid::s4u::Mailbox::by_name()`")
- .def_property_readonly("name", [](Mailbox* self) -> const std::string {
+ .def_property_readonly("name", [](const Mailbox* self) -> const std::string {
return std::string(self->get_name().c_str()); // Convert from xbt::string because of MC
}, "The name of that mailbox, see :cpp:func:`simgrid::s4u::Mailbox::get_name()`")
.def("put", [](Mailbox* self, py::object data, int size) {
"Test whether the communication is terminated, see :cpp:func:`simgrid::s4u::Comm::test()`")
.def("wait", [](simgrid::s4u::CommPtr self) { self->wait(); },
"Block until the completion of that communication, see :cpp:func:`simgrid::s4u::Comm::wait()`")
- .def("wait_all", [](std::vector<simgrid::s4u::CommPtr>* comms) { simgrid::s4u::Comm::wait_all(comms); },
+ .def("wait_all", [](const std::vector<simgrid::s4u::CommPtr>* comms) { simgrid::s4u::Comm::wait_all(comms); },
"Block until the completion of all communications in the list, see "
":cpp:func:`simgrid::s4u::Comm::wait_all()`")
.def(
- "wait_any", [](std::vector<simgrid::s4u::CommPtr>* comms) { return simgrid::s4u::Comm::wait_any(comms); },
+ "wait_any",
+ [](const std::vector<simgrid::s4u::CommPtr>* comms) { return simgrid::s4u::Comm::wait_any(comms); },
"Block until the completion of any communication in the list and return the index of the terminated one, see "
":cpp:func:`simgrid::s4u::Comm::wait_any()`");
py::class_<simgrid::s4u::Exec, simgrid::s4u::ExecPtr>(m, "Exec", "Execution, see :ref:`class s4u::Exec <API_s4u_Exec>`")