1 /* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SIMIX_SYNCHRO_IO_HPP
7 #define SIMIX_SYNCHRO_IO_HPP
9 #include "src/kernel/activity/ActivityImpl.hpp"
10 #include "surf/surf.hpp"
11 #include <simgrid/s4u/Io.hpp>
17 class XBT_PUBLIC IoImpl : public ActivityImpl_T<IoImpl> {
18 resource::StorageImpl* storage_ = nullptr;
19 resource::DiskImpl* disk_ = nullptr;
21 s4u::Io::OpType type_ = s4u::Io::OpType::READ;
22 sg_size_t performed_ioops_ = 0;
25 IoImpl& set_size(sg_size_t size);
26 IoImpl& set_type(s4u::Io::OpType type);
27 IoImpl& set_storage(resource::StorageImpl* storage);
28 IoImpl& set_disk(resource::DiskImpl* disk);
30 sg_size_t get_performed_ioops() { return performed_ioops_; }
34 void finish() override;
36 static xbt::signal<void(IoImpl const&)> on_start;
37 static xbt::signal<void(IoImpl const&)> on_completion;
39 } // namespace activity
41 } // namespace simgrid