From: Martin Quinson Date: Sun, 10 Jan 2021 15:05:45 +0000 (+0100) Subject: New: s4u::Comm::get_dst_data() X-Git-Tag: v3.27~580^2~3 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d694f7099c5ac2ba18a103b36b1563d8da667e65 New: s4u::Comm::get_dst_data() --- diff --git a/ChangeLog b/ChangeLog index 9897130eb6..933eb36256 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ S4U: type of the pointee. Untyped functions are deprecated. Use Mailbox::get() or Mailbox::get_async() if you really want to play with void*. - Unify the interface of Activity::on_{start/activity} +- New function: Comm::get_dst_data() ---------------------------------------------------------------------------- diff --git a/include/simgrid/s4u/Comm.hpp b/include/simgrid/s4u/Comm.hpp index 2c6be0f62b..20f031f317 100644 --- a/include/simgrid/s4u/Comm.hpp +++ b/include/simgrid/s4u/Comm.hpp @@ -107,6 +107,8 @@ public: * * That's a buffer where the sent data will be copied */ CommPtr set_dst_data(void** buff, size_t size); + /** Retrieve where the data will be copied on the receiver side */ + void* get_dst_data(); /** Retrieve the mailbox on which this comm acts */ Mailbox* get_mailbox() const; diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index 55a79e5aa7..a7ab9e31ff 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -95,10 +95,13 @@ CommPtr Comm::set_dst_data(void** buff) dst_buff_ = buff; return this; } +void* Comm::get_dst_data() +{ + return dst_buff_; +} size_t Comm::get_dst_data_size() const { - xbt_assert(state_ == State::FINISHED, "You cannot use %s before your communication terminated", __FUNCTION__); return dst_buff_size_; } CommPtr Comm::set_dst_data(void** buff, size_t size)