Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc' into mc++
[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);
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);
55
56   StorageActionPtr open(const char* mount, const char* path);
57   StorageActionPtr close(surf_file_t fd);
58   StorageActionPtr ls(const char *path);
59   xbt_dict_t getContent();
60   sg_size_t getSize();
61   StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
62   StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
63   void rename(const char *src, const char *dest);
64
65   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
66   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
67 };
68
69 /**********
70  * Action *
71  **********/
72
73 class StorageN11Action : public StorageAction {
74 public:
75         StorageN11Action() {}; //FIXME:REMOVE
76   StorageN11Action(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type);
77   void suspend();
78   int unref();
79   void cancel();
80   //FIXME:??void recycle();
81   void resume();
82   bool isSuspended();
83   void setMaxDuration(double duration);
84   void setPriority(double priority);
85
86 };
87
88 #endif /* STORAGE_N11_HPP_ */