WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
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
wrench::Block::getFileId
std::string getFileId()
Get the file id.
Definition: Block.cpp:47
wrench::Block::setDirty
void setDirty(bool is_dirty)
Set the block's dirty status.
Definition: Block.cpp:111
wrench::Block::getLocation
const std::shared_ptr< FileLocation > & getLocation() const
Get the block's location.
Definition: Block.cpp:151
wrench::Block::setLastAccess
void setLastAccess(double last_access)
Set the block's last access time.
Definition: Block.cpp:95
wrench::Block::split
Block * split(double remaining)
Split a block.
Definition: Block.cpp:136
wrench::Block::isDirty
bool isDirty() const
Get the block's dirty status.
Definition: Block.cpp:103
wrench
Definition: Action.cpp:28
wrench::Block::getSize
double getSize() const
Get the block's size.
Definition: Block.cpp:71
wrench::Block::setSize
void setSize(double size)
Set the block's size.
Definition: Block.cpp:79
wrench::Block::getDirtyTime
double getDirtyTime() const
Get the block's dirty time.
Definition: Block.cpp:119
wrench::Block::setFileId
void setFileId(std::string &fid)
Set the block's file id.
Definition: Block.cpp:55
wrench::Block
A class that implements a "block" abstraction for memory management.
Definition: Block.h:26
wrench::Block::getLastAccess
double getLastAccess() const
Get the block's last access time.
Definition: Block.cpp:87
wrench::Block::Block
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
wrench::Block::setDirtyTime
void setDirtyTime(double dirty_time)
Set the block's dirty time.
Definition: Block.cpp:127