forked from nykez/memory-simulator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReferenceStats.h
40 lines (36 loc) · 1.24 KB
/
ReferenceStats.h
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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Project: GroupProject
// File Name: ReferenceStats.h
// Description: Holds reference information for disk, memory, and page table.
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef REF_STATS_H
#define REF_STATS_H
/// <summary>
/// Reference info for disk, memory, and page table.
/// </summary>
struct ReferenceStats {
int pageTableRefCount = 0; // times we touched page table.
int mainMemoryRefCount = 0; // times we touched main memory.
int diskRefCount = 0; // times we touched disk.
/// <summary>
/// Default Constructor
/// </summary>
/// <param name=""></param>
/// <returns></returns>
ReferenceStats() {
}
/// <summary>
/// Parameterized constructor.
/// </summary>
/// <param name="page">page reference count</param>
/// <param name="mem">memory reference count</param>
/// <param name="disk">disk reference count</param>
ReferenceStats(int page, int mem, int disk) {
pageTableRefCount = page;
mainMemoryRefCount = mem;
diskRefCount = disk;
}
};
#endif