X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/001737a15701027974d89260771284a45013d2cd..ff498d2432d650dc50282b04e3bd175a588eef8c:/src/kernel/activity/CommImpl.hpp diff --git a/src/kernel/activity/CommImpl.hpp b/src/kernel/activity/CommImpl.hpp index f881e04d38..0339005099 100644 --- a/src/kernel/activity/CommImpl.hpp +++ b/src/kernel/activity/CommImpl.hpp @@ -15,24 +15,32 @@ namespace simgrid { namespace kernel { namespace activity { -class XBT_PUBLIC CommImpl : public ActivityImpl { +class XBT_PUBLIC CommImpl : public ActivityImpl_T { ~CommImpl() override; void cleanupSurf(); + double rate_ = 0.0; + double size_ = 0.0; + public: enum class Type { SEND = 0, RECEIVE, READY, DONE }; - explicit CommImpl(Type type); - void start(); + CommImpl& set_type(CommImpl::Type type); + CommImpl& set_size(double size); + double get_rate() { return rate_; } + CommImpl& set_rate(double rate); + CommImpl& set_src_buff(void* buff, size_t size); + CommImpl& set_dst_buff(void* buff, size_t* size); + + CommImpl* start(); void copy_data(); void suspend() override; void resume() override; void post() override; void finish() override; void cancel(); - double remains(); - CommImpl::Type type; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */ + CommImpl::Type type_; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */ MailboxImpl* mbox = nullptr; /* Rendez-vous where the comm is queued */ #if SIMGRID_HAVE_MC @@ -40,7 +48,7 @@ public: (comm.mbox set to nullptr when the communication is removed from the mailbox (used as garbage collector)) */ #endif - bool detached = false; /* If detached or not */ + bool detached_ = false; /* If detached or not */ void (*clean_fun)(void*) = nullptr; /* Function to clean the detached src_buf if something goes wrong */ int (*match_fun)(void*, void*, CommImpl*) = nullptr; /* Filter function used by the other side. It is used when @@ -49,13 +57,10 @@ expectations of the other side, too. See */ void (*copy_data_fun)(CommImpl*, void*, size_t) = nullptr; /* Surf action data */ - resource::Action* surf_action_ = nullptr; /* The Surf communication action encapsulated */ resource::Action* src_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */ resource::Action* dst_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */ actor::ActorImplPtr src_actor_ = nullptr; actor::ActorImplPtr dst_actor_ = nullptr; - double rate_ = 0.0; - double task_size_ = 0.0; /* Data to be transfered */ void* src_buff_ = nullptr;