-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemBlock.cpp
82 lines (69 loc) · 1.39 KB
/
MemBlock.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* Author: Shania Dhani
* Date Modified May 12, 2020
*
* MemBlock is the foundational units that represent processes in memory.
*/
#include "MemBlock.hpp"
// default constructor
MemBlock::MemBlock() {}
// parameterized constructor
MemBlock::MemBlock(const long long int &start, const long long int &end, const long long int &pid,
const long long int &memory_chunk, const bool active)
{
start_ = start;
end_ = end;
pid_ = pid;
memory_chunk_ = memory_chunk;
active_ = active;
}
// set start range
void MemBlock::setStart(const long long int &start)
{
start_ = start;
}
// set end range
void MemBlock::setEnd(const long long int &end)
{
end_ = end;
}
// set memory_chunk size
void MemBlock::setMemoryChunk(const long long int &memory_chunk)
{
memory_chunk_ = memory_chunk;
}
// set pid
void MemBlock::setPID(const long long int &pid)
{
pid_ = pid;
}
// set active
void MemBlock::setActive(const bool &is_active)
{
active_ = is_active;
}
// @return start range
long long int MemBlock::start() const
{
return start_;
}
// @return end range
long long int MemBlock::end() const
{
return end_;
}
// @return pid
long long int MemBlock::pid() const
{
return pid_;
}
// @return process memory chunk size
long long int MemBlock::memoryChunk() const
{
return memory_chunk_;
}
// @return process in memory activity
bool MemBlock::active() const
{
return active_;
}