Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
55619bfa3952ecf5fc871ece425de89053e95e8d
[simgrid.git] / src / kernel / activity / IoImpl.hpp
1 /* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef SIMIX_SYNCHRO_IO_HPP
7 #define SIMIX_SYNCHRO_IO_HPP
8
9 #include "src/kernel/activity/ActivityImpl.hpp"
10 #include "surf/surf.hpp"
11 #include <simgrid/s4u/Io.hpp>
12
13 namespace simgrid {
14 namespace kernel {
15 namespace activity {
16
17 class XBT_PUBLIC IoImpl : public ActivityImpl {
18 public:
19   ~IoImpl() override;
20   explicit IoImpl(std::string name, simgrid::surf::StorageImpl* storage);
21
22   void start(sg_size_t size, simgrid::s4u::Io::OpType type);
23   void suspend() override;
24   void resume() override;
25   void post() override;
26   void cancel();
27   double get_remaining();
28   sg_size_t get_performed_ioops() { return performed_ioops_; }
29
30   simgrid::surf::StorageImpl* storage_            = nullptr;
31   simgrid::kernel::resource::Action* surf_action_ = nullptr;
32   sg_size_t performed_ioops_                      = 0;
33   static simgrid::xbt::signal<void(kernel::activity::IoImplPtr)> on_start;
34   static simgrid::xbt::signal<void(kernel::activity::IoImplPtr)> on_completion;
35 };
36 }
37 }
38 } // namespace simgrid::kernel::activity
39
40 #endif