-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddress.cpp
43 lines (32 loc) · 929 Bytes
/
Address.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
#include "Address.h"
#include <iostream>
using namespace std;
Address::Address(int processId, int pageNumber, bool dirty)
{
this->pageNumber = pageNumber;
this->dirty = dirty;
this->processId = processId;
}
Address::Address(const Address& address)
{
pageNumber = address.getPageNumber();
dirty = address.getDirty();
processId = address.getProcessId();
}
bool Address::operator == (const Address& address) const
{
return (pageNumber == address.pageNumber) && (processId == address.processId);
}
ostream &operator << (ostream& left, const Address& ob)
{
left << ob.getPageNumber() << " " << ob.getDirty();
return left;
}
Address& Address::operator = (const Address& address)
{
if (this == &address) return *this;
pageNumber = address.pageNumber;
processId = address.processId;
dirty = address.dirty;
return *this;
}