enum class CommImplType { SEND, RECEIVE };
+using timeout_action_type = std::unique_ptr<resource::Action, std::function<void(resource::Action*)>>;
+
class XBT_PUBLIC CommImpl : public ActivityImpl_T<CommImpl> {
~CommImpl() override;
- void cleanup_surf();
static std::function<void(CommImpl*, void*, size_t)> copy_data_callback_;
void suspend() override;
void resume() override;
void cancel() override;
- void post() override;
void set_exception(actor::ActorImpl* issuer) override;
void finish() override;
expectations of the other side, too. See */
std::function<void(CommImpl*, void*, size_t)> copy_data_fun;
- /* Surf action data */
- resource::Action* src_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */
- resource::Action* dst_timeout_ = nullptr; /* Surf's actions to instrument the timeouts */
+ /* Model actions */
+ timeout_action_type src_timeout_{nullptr, [](resource::Action* a) { a->unref(); }}; /* timeout set by the sender */
+ timeout_action_type dst_timeout_{nullptr, [](resource::Action* a) { a->unref(); }}; /* timeout set by the receiver */
+
actor::ActorImplPtr src_actor_ = nullptr;
actor::ActorImplPtr dst_actor_ = nullptr;
void* src_data_ = nullptr; /* User data associated to the communication */
void* dst_data_ = nullptr;
- static xbt::signal<void(CommImpl const&)> on_start;
- static xbt::signal<void(CommImpl const&)> on_completion;
};
} // namespace simgrid::kernel::activity