Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright notices
[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 "storage_interface.hpp"
8
9 #ifndef STORAGE_N11_HPP_
10 #define STORAGE_N11_HPP_
11
12 /***********
13  * Classes *
14  ***********/
15
16 class StorageN11Model;
17 class StorageN11;
18 class StorageN11Action;
19
20 /*********
21  * Model *
22  *********/
23
24 class StorageN11Model : public StorageModel {
25 public:
26   StorageN11Model();
27   ~StorageN11Model();
28   Storage *createStorage(const char* id, const char* type_id,
29                    const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
30   void addTraces(){DIE_IMPOSSIBLE;}
31   double shareResources(double now);
32   void updateActionsState(double now, double delta);
33 };
34
35 /************
36  * Resource *
37  ************/
38
39 class StorageN11 : public Storage {
40 public:
41   StorageN11(StorageModel *model, const char* name, xbt_dict_t properties,
42                      lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
43                      const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
44
45   StorageAction *open(const char* mount, const char* path);
46   StorageAction *close(surf_file_t fd);
47   StorageAction *ls(const char *path);
48   StorageAction *read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param  *??
49   StorageAction *write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param  *??
50   void rename(const char *src, const char *dest);
51
52   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
53   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
54 };
55
56 /**********
57  * Action *
58  **********/
59
60 class StorageN11Action : public StorageAction {
61 public:
62   StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type);
63   void suspend();
64   int unref();
65   void cancel();
66   void resume();
67   bool isSuspended();
68   void setMaxDuration(double duration);
69   void setPriority(double priority);
70
71 };
72
73 #endif /* STORAGE_N11_HPP_ */