-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlink.cc
More file actions
55 lines (38 loc) · 988 Bytes
/
link.cc
File metadata and controls
55 lines (38 loc) · 988 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 "link.h"
Link::Link(const unsigned s, const unsigned d, SimulationContext *c, double b, double l) :
src(s), dest(d), context(c), bw(b), lat(l) {}
Link::Link()
{}
Link::Link(const Link &rhs) :
src(rhs.src), dest(rhs.dest), context(rhs.context), bw(rhs.bw), lat(rhs.lat) {}
Link & Link::operator=(const Link &rhs)
{
return *(new (this) Link(rhs));
}
Link::~Link()
{}
bool Link::Matches(const Link &rhs) const
{
return src==rhs.src && dest==rhs.dest;
}
void Link::SetSrc(const unsigned s)
{ src=s;}
unsigned Link::GetSrc() const
{ return src;}
void Link::SetDest(const unsigned d)
{ dest=d;}
unsigned Link::GetDest() const
{ return dest;}
void Link::SetLatency(const double l)
{ lat=l;}
double Link::GetLatency() const
{ return lat; }
void Link::SetBW(const double b)
{ bw=b;}
double Link::GetBW() const
{ return bw;}
ostream & Link::Print(ostream &os) const
{
os << "Link(src="<<src<<", dest="<<dest<<", lat="<<lat<<", bw="<<bw<<")";
return os;
}