Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ns3: inline a header file
[simgrid.git] / src / surf / storage_n11.hpp
1 /* Copyright (c) 2013-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <xbt/base.h>
8
9 #include "StorageImpl.hpp"
10
11 #ifndef STORAGE_N11_HPP_
12 #define STORAGE_N11_HPP_
13
14 namespace simgrid {
15 namespace surf {
16
17 /***********
18  * Classes *
19  ***********/
20
21 class XBT_PRIVATE StorageN11Model;
22 class XBT_PRIVATE StorageN11;
23 class XBT_PRIVATE StorageN11Action;
24
25 /*********
26  * Model *
27  *********/
28
29 class StorageN11Model : public StorageModel {
30 public:
31   StorageImpl* createStorage(std::string id, std::string type_id, std::string content_name,
32                              std::string attach) override;
33   double nextOccuringEvent(double now) override;
34   void updateActionsState(double now, double delta) override;
35 };
36
37 /************
38  * Resource *
39  ************/
40
41 class StorageN11 : public StorageImpl {
42 public:
43   StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
44              std::string type_id, std::string content_name, sg_size_t size, std::string attach);
45   virtual ~StorageN11() = default;
46   StorageAction* read(sg_size_t size);
47   StorageAction* write(sg_size_t size);
48 };
49
50 /**********
51  * Action *
52  **********/
53
54 class StorageN11Action : public StorageAction {
55 public:
56   StorageN11Action(Model* model, double cost, bool failed, StorageImpl* storage, e_surf_action_storage_type_t type);
57   void suspend();
58   int unref();
59   void cancel();
60   void resume();
61   bool isSuspended();
62   void setMaxDuration(double duration);
63   void setSharingWeight(double priority);
64 };
65
66 }
67 }
68
69 #endif /* STORAGE_N11_HPP_ */