A class that implements a "block" abstraction for memory management. More...
#include <Block.h>
Public Member Functions | |
Block (Block *blk) | |
Constructor (that does a copy) More... | |
Block (std::string fid, std::shared_ptr< FileLocation > location, double sz, double last_access, bool is_dirty, double dirty_time) | |
Constructor. More... | |
double | getDirtyTime () const |
Get the block's dirty time. More... | |
std::string | getFileId () |
Get the file id. More... | |
double | getLastAccess () const |
Get the block's last access time. More... | |
const std::shared_ptr< FileLocation > & | getLocation () const |
Get the block's location. More... | |
double | getSize () const |
Get the block's size. More... | |
bool | isDirty () const |
Get the block's dirty status. More... | |
void | setDirty (bool is_dirty) |
Set the block's dirty status. More... | |
void | setDirtyTime (double dirty_time) |
Set the block's dirty time. More... | |
void | setFileId (std::string &fid) |
Set the block's file id. More... | |
void | setLastAccess (double last_access) |
Set the block's last access time. More... | |
void | setSize (double size) |
Set the block's size. More... | |
Block * | split (double remaining) |
Split a block. More... | |
Detailed Description
A class that implements a "block" abstraction for memory management.
Constructor & Destructor Documentation
◆ Block() [1/2]
wrench::Block::Block | ( | std::string | fid, |
std::shared_ptr< FileLocation > | location, | ||
double | sz, | ||
double | last_access, | ||
bool | is_dirty, | ||
double | dirty_time | ||
) |
Constructor.
- Parameters
-
fid file id location file location sz file size in bytes last_access time of last access is_dirty dirty status dirty_time dirty time
◆ Block() [2/2]
wrench::Block::Block | ( | Block * | blk | ) |
Constructor (that does a copy)
- Parameters
-
blk a block
Member Function Documentation
◆ getDirtyTime()
double wrench::Block::getDirtyTime | ( | ) | const |
Get the block's dirty time.
- Returns
- a date
◆ getFileId()
std::string wrench::Block::getFileId | ( | ) |
Get the file id.
- Returns
- the file id
◆ getLastAccess()
double wrench::Block::getLastAccess | ( | ) | const |
Get the block's last access time.
- Returns
- a date
◆ getLocation()
const std::shared_ptr< FileLocation > & wrench::Block::getLocation | ( | ) | const |
Get the block's location.
- Returns
- the block's location
◆ getSize()
double wrench::Block::getSize | ( | ) | const |
Get the block's size.
- Returns
- a size in bytes
◆ isDirty()
bool wrench::Block::isDirty | ( | ) | const |
Get the block's dirty status.
- Returns
- true or false
◆ setDirty()
void wrench::Block::setDirty | ( | bool | is_dirty | ) |
Set the block's dirty status.
- Parameters
-
is_dirty true or false
◆ setDirtyTime()
void wrench::Block::setDirtyTime | ( | double | dirty_time | ) |
Set the block's dirty time.
- Parameters
-
dirty_time a date
◆ setFileId()
void wrench::Block::setFileId | ( | std::string & | fid | ) |
Set the block's file id.
- Parameters
-
fid a file id
◆ setLastAccess()
void wrench::Block::setLastAccess | ( | double | last_access | ) |
Set the block's last access time.
- Parameters
-
last_access a date
◆ setSize()
void wrench::Block::setSize | ( | double | size | ) |
Set the block's size.
- Parameters
-
size a size in bytes
◆ split()
Block * wrench::Block::split | ( | double | remaining | ) |
Split a block.
- Parameters
-
remaining a number of bytes
- Returns
- : a pointer to a new block
The documentation for this class was generated from the following files:
- Block.h
- Block.cpp