Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics in AsCluster and friends
[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 "storage_interface.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   StorageN11Model();
32   ~StorageN11Model();
33   Storage *createStorage(const char* id, const char* type_id,
34        const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach) override;
35   double next_occuring_event(double now) override;
36   void updateActionsState(double now, double delta) override;
37 };
38
39 /************
40  * Resource *
41  ************/
42
43 class StorageN11 : public Storage {
44 public:
45   StorageN11(StorageModel *model, const char* name, xbt_dict_t properties,
46          lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
47          const char* type_id, char *content_name, const char *content_type, sg_size_t size, char *attach);
48
49   StorageAction *open(const char* mount, const char* path);
50   StorageAction *close(surf_file_t fd);
51   StorageAction *ls(const char *path);
52   StorageAction *read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param  *??
53   StorageAction *write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param  *??
54   void rename(const char *src, const char *dest);
55
56   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
57   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
58 };
59
60 /**********
61  * Action *
62  **********/
63
64 class StorageN11Action : public StorageAction {
65 public:
66   StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type);
67   void suspend();
68   int unref();
69   void cancel();
70   void resume();
71   bool isSuspended();
72   void setMaxDuration(double duration);
73   void setPriority(double priority);
74
75 };
76
77 }
78 }
79
80 #endif /* STORAGE_N11_HPP_ */