X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/939476f1fc7630eb237535b07ed0deef77ce1b24..1f5cc4e090af49a98da0e25e9ee21a8ce6ce30f8:/src/kernel/activity/IoImpl.hpp diff --git a/src/kernel/activity/IoImpl.hpp b/src/kernel/activity/IoImpl.hpp index f44f09044a..3bd9c7b5cc 100644 --- a/src/kernel/activity/IoImpl.hpp +++ b/src/kernel/activity/IoImpl.hpp @@ -1,39 +1,45 @@ -/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2021. 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. */ -#ifndef SIMIX_SYNCHRO_IO_HPP -#define SIMIX_SYNCHRO_IO_HPP +#ifndef SIMGRID_KERNEL_ACTIVITY_IO_HPP +#define SIMGRID_KERNEL_ACTIVITY_IO_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.hpp" +#include namespace simgrid { namespace kernel { namespace activity { -class XBT_PUBLIC IoImpl : public ActivityImpl { - ~IoImpl() override; +class XBT_PUBLIC IoImpl : public ActivityImpl_T { + resource::DiskImpl* disk_ = nullptr; + sg_size_t size_ = 0; + s4u::Io::OpType type_ = s4u::Io::OpType::READ; + sg_size_t performed_ioops_ = 0; + resource::Action* timeout_detector_ = nullptr; + s4u::Io* piface_; public: - explicit IoImpl(std::string name, resource::Action* surf_action, s4u::Storage* storage); + IoImpl(); + s4u::Io* get_iface() { return piface_; } -public: - void suspend() override; - void resume() override; - void post() override; - void cancel(); - double get_remaining(); + IoImpl& set_timeout(double timeout) override; + IoImpl& set_size(sg_size_t size); + IoImpl& set_type(s4u::Io::OpType type); + IoImpl& set_disk(resource::DiskImpl* disk); - s4u::Storage* storage_ = nullptr; - simgrid::kernel::resource::Action* surf_action_ = nullptr; + sg_size_t get_performed_ioops() const { return performed_ioops_; } + resource::DiskImpl* get_disk() const { return disk_; } - static simgrid::xbt::signal on_creation; - static simgrid::xbt::signal on_completion; + IoImpl* start(); + void post() override; + void finish() override; + static void wait_any_for(actor::ActorImpl* issuer, const std::vector& ios, double timeout); }; -} -} -} // namespace simgrid::kernel::activity +} // namespace activity +} // namespace kernel +} // namespace simgrid #endif