-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoint.hpp
58 lines (49 loc) · 1.59 KB
/
endpoint.hpp
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
55
56
57
58
#ifndef ROUTING_ENDPOINT_HPP
#define ROUTING_ENDPOINT_HPP
#include <stdint.h>
namespace Routing
{
//====================================================
// Represents the endpoint of a directional edge (i.e. the destination)
class Endpoint
{
public:
//----------------------------------------------------
// Alternate constructor
Endpoint(const uint32_t id, const float weight = 1.0);
//----------------------------------------------------
// Sets the endpoint id
void setId(const uint32_t id)
{
this->id_ = id;
}
//----------------------------------------------------
// Returns the endpoint id
uint32_t getId() const
{
return this->id_;
}
//----------------------------------------------------
// Sets the endpoint weight
void setWeight(const uint32_t weight)
{
this->weight_ = weight;
}
//----------------------------------------------------
// Returns the endpoint weight
float getWeight() const
{
return this->weight_;
}
//----------------------------------------------------
// Compares two endpoints by id
inline bool operator<(const Endpoint& rhs) const
{
return this->id_ < rhs.id_;
}
private:
uint32_t id_;
float weight_;
};
}
#endif