-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcache_set.hpp
More file actions
44 lines (27 loc) · 769 Bytes
/
Copy pathcache_set.hpp
File metadata and controls
44 lines (27 loc) · 769 Bytes
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
#ifndef CACHESET_H
#define CACHESET_H
#include "cache_line.hpp"
#include <algorithm>
#include <cstddef>
#include <list>
class CacheSet {
public:
size_t maxSize;
size_t currentSize;
std::list<CacheLine> cacheSet;
public:
CacheSet(size_t maxSize);
bool checkCacheLine(size_t tag);
bool invalidateCacheLine(size_t tag);
void addCacheLine(size_t tag, State state);
bool readCacheLine(size_t tag);
bool updateCacheLine(size_t tag, State state);
State checkCacheLineState(size_t tag);
bool setCacheLineState(size_t tag, State state);
bool checkCacheSetFull();
bool isEmpty();
unsigned int size() { return cacheSet.size(); }
CacheLine getFirst();
friend class Cache;
};
#endif // CACHESET_H