From d694f7099c5ac2ba18a103b36b1563d8da667e65 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 10 Jan 2021 16:05:45 +0100 Subject: [PATCH] New: s4u::Comm::get_dst_data() --- ChangeLog | 1 + include/simgrid/s4u/Comm.hpp | 2 ++ src/s4u/s4u_Comm.cpp | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) 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) -- 2.20.1