Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / src / surf / storage_n11.hpp
1 /* Copyright (c) 2013-2014. 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 typedef StorageN11Model *StorageN11ModelPtr;
18
19 class StorageN11;
20 typedef StorageN11 *StorageN11Ptr;
21
22 class StorageN11;
23 typedef StorageN11 *StorageN11Ptr;
24
25 class StorageN11Action;
26 typedef StorageN11Action *StorageN11ActionPtr;
27
28 class StorageN11Action;
29 typedef StorageN11Action *StorageN11ActionPtr;
30
31
32 /*********
33  * Model *
34  *********/
35
36 class StorageN11Model : public StorageModel {
37 public:
38   StorageN11Model();
39   ~StorageN11Model();
40   StoragePtr createResource(const char* id, const char* type_id,
41                    const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
42   double shareResources(double now);
43   void updateActionsState(double now, double delta);
44 };
45
46 /************
47  * Resource *
48  ************/
49
50 class StorageN11 : public Storage {
51 public:
52   StorageN11(StorageModelPtr model, const char* name, xbt_dict_t properties,
53                      lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
54                      const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
55
56   StorageActionPtr open(char* mount, char* path);
57   StorageActionPtr close(surf_file_t fd);
58   StorageActionPtr ls(const char *path);
59   StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
60   StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
61   void rename(const char *src, const char *dest);
62
63   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
64   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
65 };
66
67 /**********
68  * Action *
69  **********/
70
71 class StorageN11Action : public StorageAction {
72 public:
73         StorageN11Action() {}; //FIXME:REMOVE
74   StorageN11Action(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type);
75   void suspend();
76   int unref();
77   void cancel();
78   //FIXME:??void recycle();
79   void resume();
80   bool isSuspended();
81   void setMaxDuration(double duration);
82   void setPriority(double priority);
83
84 };
85
86 #endif /* STORAGE_N11_HPP_ */