A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update python/clusters-multicpu to the new API.
[simgrid.git]
/
include
/
simgrid
/
s4u
/
Mailbox.hpp
diff --git
a/include/simgrid/s4u/Mailbox.hpp
b/include/simgrid/s4u/Mailbox.hpp
index 96dab88c239c168de77906ad8de3739759fde845..b8eddff97667fbabb970e41fe7513c67e94bfbef 100644
(file)
--- a/
include/simgrid/s4u/Mailbox.hpp
+++ b/
include/simgrid/s4u/Mailbox.hpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2006-202
2
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-202
3
. 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. */
/* 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. */
@@
-10,13
+10,11
@@
#include <simgrid/s4u/Actor.hpp>
#include <simgrid/s4u/Comm.hpp>
#include <smpi/forward.hpp>
#include <simgrid/s4u/Actor.hpp>
#include <simgrid/s4u/Comm.hpp>
#include <smpi/forward.hpp>
-#include <xbt/string.hpp>
#include <memory>
#include <string>
#include <memory>
#include <string>
-namespace simgrid {
-namespace s4u {
+namespace simgrid::s4u {
/** @brief Mailboxes: Network rendez-vous points. */
class XBT_PUBLIC Mailbox {
/** @brief Mailboxes: Network rendez-vous points. */
class XBT_PUBLIC Mailbox {
@@
-36,11
+34,11
@@
protected:
public:
/** @brief Retrieves the name of that mailbox as a C++ string */
public:
/** @brief Retrieves the name of that mailbox as a C++ string */
- const
xbt
::string& get_name() const;
+ const
std
::string& get_name() const;
/** @brief Retrieves the name of that mailbox as a C string */
const char* get_cname() const;
/** @brief Retrieves the name of that mailbox as a C string */
const char* get_cname() const;
- /** Retrieve the mailbox associated to the given name. Mailboxes are created on demand. */
+ /**
\static
Retrieve the mailbox associated to the given name. Mailboxes are created on demand. */
static Mailbox* by_name(const std::string& name);
/** Returns whether the mailbox contains queued communications */
static Mailbox* by_name(const std::string& name);
/** Returns whether the mailbox contains queued communications */
@@
-55,7
+53,11
@@
public:
/** Look if there is a communication going on in a mailbox and return the PID of the sender actor */
aid_t listen_from() const;
/** Look if there is a communication going on in a mailbox and return the PID of the sender actor */
aid_t listen_from() const;
- /** Check if there is a communication ready to be consumed from a mailbox. */
+ /** Check if there is a communication ready to be consumed from a mailbox.
+ * \beginrst
+ * See :ref:`this example <s4u_ex_mailbox_ready>`.
+ * \endrst
+ */
bool ready() const;
/** Gets the first element in the queue (without dequeuing it), or nullptr if none is there */
bool ready() const;
/** Gets the first element in the queue (without dequeuing it), or nullptr if none is there */
@@
-116,6
+118,9
@@
public:
CommPtr get_init();
/** Creates and start an async data reception to that mailbox */
template <typename T> CommPtr get_async(T** data);
CommPtr get_init();
/** Creates and start an async data reception to that mailbox */
template <typename T> CommPtr get_async(T** data);
+ /** Creates and start an async data reception to that mailbox. Since the data location is not provided, you'll have to
+ * use Comm::get_payload once the comm terminates */
+ CommPtr get_async();
/** Blocking data reception */
template <typename T> T* get();
/** Blocking data reception */
template <typename T> T* get();
@@
-131,7
+136,7
@@
public:
template <typename T> CommPtr Mailbox::get_async(T** data)
{
CommPtr res = get_init()->set_dst_data(reinterpret_cast<void**>(data), sizeof(void*));
template <typename T> CommPtr Mailbox::get_async(T** data)
{
CommPtr res = get_init()->set_dst_data(reinterpret_cast<void**>(data), sizeof(void*));
- res->
vetoable_
start();
+ res->start();
return res;
}
return res;
}
@@
-148,7
+153,6
@@
template <typename T> T* Mailbox::get(double timeout)
get_async<T>(&res)->wait_for(timeout);
return res;
}
get_async<T>(&res)->wait_for(timeout);
return res;
}
-} // namespace s4u
-} // namespace simgrid
+} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_MAILBOX_HPP */
#endif /* SIMGRID_S4U_MAILBOX_HPP */