1 /* Copyright (c) 2013-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. */
8 #include "StorageImpl.hpp"
10 #ifndef STORAGE_N11_HPP_
11 #define STORAGE_N11_HPP_
21 class XBT_PRIVATE StorageN11Model;
22 class XBT_PRIVATE StorageN11;
23 class XBT_PRIVATE StorageN11Action;
29 class StorageN11Model : public StorageModel {
32 StorageImpl* createStorage(const std::string& id, const std::string& type_id, const std::string& content_name,
33 const std::string& attach) override;
34 double next_occuring_event(double now) override;
35 void update_actions_state(double now, double delta) override;
42 class StorageN11 : public StorageImpl {
44 StorageN11(StorageModel* model, const std::string& name, kernel::lmm::System* maxminSystem, double bread,
45 double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
46 const std::string& attach);
47 virtual ~StorageN11() = default;
48 StorageAction* io_start(sg_size_t size, s4u::Io::OpType type) override;
49 StorageAction* read(sg_size_t size) override;
50 StorageAction* write(sg_size_t size) override;
57 class StorageN11Action : public StorageAction {
59 StorageN11Action(Model* model, double cost, bool failed, StorageImpl* storage, s4u::Io::OpType type);
60 void suspend() override;
61 void cancel() override;
62 void resume() override;
63 void set_max_duration(double duration) override;
64 void set_sharing_penalty(double sharing_penalty) override;
65 void update_remains_lazy(double now) override;
68 } // namespace resource
70 } // namespace simgrid
71 #endif /* STORAGE_N11_HPP_ */