Logo AND Algorithmique Numérique Distribuée

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