Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
653d1915176c5304baccaec27d027e5c46b26d97
[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(const std::string& name, resource::StorageImpl* storage);
21
22   IoImpl* start(sg_size_t size, s4u::Io::OpType type);
23   void post() override;
24   void finish() override;
25   void cancel();
26   double get_remaining();
27   sg_size_t get_performed_ioops() { return performed_ioops_; }
28
29   resource::StorageImpl* storage_                 = nullptr;
30   sg_size_t performed_ioops_                      = 0;
31   static xbt::signal<void(IoImplPtr)> on_start;
32   static xbt::signal<void(IoImplPtr)> on_completion;
33 };
34 }
35 }
36 } // namespace simgrid::kernel::activity
37
38 #endif