Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9c8d8665ea742bc816de2bf6267d025d77cf96a2
[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   Storage* createStorage(const char* id, const char* type_id, const char* content_name, const char* attach) override;
32   double nextOccuringEvent(double now) override;
33   void updateActionsState(double now, double delta) override;
34 };
35
36 /************
37  * Resource *
38  ************/
39
40 class StorageN11 : public Storage {
41 public:
42   StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
43              const char* type_id, char* content_name, sg_size_t size, char* attach);
44   StorageAction *open(const char* mount, const char* path);
45   StorageAction *close(surf_file_t fd);
46   StorageAction *ls(const char *path);
47   StorageAction* read(surf_file_t fd, sg_size_t size);
48   StorageAction* write(surf_file_t fd, sg_size_t size);
49   void rename(const char *src, const char *dest);
50 };
51
52 /**********
53  * Action *
54  **********/
55
56 class StorageN11Action : public StorageAction {
57 public:
58   StorageN11Action(Model *model, double cost, bool failed, Storage *storage, e_surf_action_storage_type_t type);
59   void suspend();
60   int unref();
61   void cancel();
62   void resume();
63   bool isSuspended();
64   void setMaxDuration(double duration);
65   void setPriority(double priority);
66
67 };
68
69 }
70 }
71
72 #endif /* STORAGE_N11_HPP_ */