Logo AND Algorithmique Numérique Distribuée

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