Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Multiple .so support for region snapshots
[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 createStorage(const char* id, const char* type_id,
41                    const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
42   void addTraces(){DIE_IMPOSSIBLE;}
43   double shareResources(double now);
44   void updateActionsState(double now, double delta);
45 };
46
47 /************
48  * Resource *
49  ************/
50
51 class StorageN11 : public Storage {
52 public:
53   StorageN11(StorageModelPtr model, const char* name, xbt_dict_t properties,
54                      lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
55                      const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
56
57   StorageActionPtr open(const char* mount, const char* path);
58   StorageActionPtr close(surf_file_t fd);
59   StorageActionPtr ls(const char *path);
60   StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
61   StorageActionPtr write(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
62   void rename(const char *src, const char *dest);
63
64   lmm_constraint_t p_constraintWrite;    /* Constraint for maximum write bandwidth*/
65   lmm_constraint_t p_constraintRead;     /* Constraint for maximum write bandwidth*/
66 };
67
68 /**********
69  * Action *
70  **********/
71
72 class StorageN11Action : public StorageAction {
73 public:
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_ */