Logo AND Algorithmique Numérique Distribuée

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