-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComputer.cpp
More file actions
54 lines (44 loc) · 755 Bytes
/
Copy pathComputer.cpp
File metadata and controls
54 lines (44 loc) · 755 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
45
46
47
48
49
50
51
52
53
54
#include "Computer.h"
Computer::Computer()
{
pm = new PhysicalMemory;
mb = new MotherBoard;
cpu = new CPU;
}
Computer::Computer(PhysicalMemory *pm, MotherBoard *mb, CPU *cpu)
{
this->pm = pm;
this->mb = mb;
this->cpu = cpu;
}
PhysicalMemory & Computer::get_pm()
{
return *pm;
}
void Computer::set_pm(PhysicalMemory *pm)
{
this->pm = pm;
}
MotherBoard & Computer::get_mb()
{
return *mb;
}
void Computer::set_mb(MotherBoard* mb)
{
this->mb = mb;
}
CPU &Computer::get_cpu()
{
return *cpu;
}
void Computer::set_cpu(CPU *cpu)
{
this->cpu = cpu;
}
// de-allocation of memory
Computer::~Computer()
{
delete pm;
delete mb;
delete cpu;
}