Block.h
1 
11 #ifndef WRENCH_BLOCK_H
12 #define WRENCH_BLOCK_H
13 
14 #include <string>
15 #include "wrench/services/storage/storage_helpers/FileLocation.h"
16 
17 namespace wrench {
18 
19  /***********************/
21  /***********************/
22 
26  class Block {
27 
28  public:
29  Block(std::string fid, std::shared_ptr<FileLocation> location, double sz,
30  double last_access, bool is_dirty, double dirty_time);
31 
32  Block(Block *blk);
33 
34  std::string getFileId();
35 
36  void setFileId(std::string &fid);
37 
38 // std::string getMountpoint();
39 
40 // void setMountpoint(std::string mountpoint);
41 
42  double getSize() const;
43 
44  void setSize(double size);
45 
46  double getLastAccess() const;
47 
48  void setLastAccess(double last_access);
49 
50  bool isDirty() const;
51 
52  void setDirty(bool is_dirty);
53 
54  double getDirtyTime() const;
55 
56  void setDirtyTime(double dirty_time);
57 
58  const std::shared_ptr<FileLocation> &getLocation() const;
59 
60  Block* split(double remaining);
61 
62  private:
63  std::string file_id;
64 // std::string mountpoint;
65  std::shared_ptr<FileLocation> location;
66  double size;
67  double last_access;
68  bool dirty;
69  double dirty_time;
70 
71  /***********************/
73  /***********************/
74  };
75 
76 }
77 
78 #endif //WRENCH_BLOCK_H
std::string getFileId()
Get the file id.
Definition: Block.cpp:47
void setDirty(bool is_dirty)
Set the block's dirty status.
Definition: Block.cpp:111
const std::shared_ptr< FileLocation > & getLocation() const
Get the block's location.
Definition: Block.cpp:151
void setLastAccess(double last_access)
Set the block's last access time.
Definition: Block.cpp:95
Block * split(double remaining)
Split a block.
Definition: Block.cpp:136
bool isDirty() const
Get the block's dirty status.
Definition: Block.cpp:103
Definition: Alarm.cpp:20
double getSize() const
Get the block's size.
Definition: Block.cpp:71
void setSize(double size)
Set the block's size.
Definition: Block.cpp:79
double getDirtyTime() const
Get the block's dirty time.
Definition: Block.cpp:119
void setFileId(std::string &fid)
Set the block's file id.
Definition: Block.cpp:55
A class that implements a "block" abstraction for memory management.
Definition: Block.h:26
double getLastAccess() const
Get the block's last access time.
Definition: Block.cpp:87
Block(std::string fid, std::shared_ptr< FileLocation > location, double sz, double last_access, bool is_dirty, double dirty_time)
Constructor.
Definition: Block.cpp:24
void setDirtyTime(double dirty_time)
Set the block's dirty time.
Definition: Block.cpp:127