NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
route.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_RIB_ROUTE_HPP
27
#define NFD_RIB_ROUTE_HPP
28
29
#include "common.hpp"
30
#include "
core/scheduler.hpp
"
31
#include <ndn-cxx/encoding/nfd-constants.hpp>
32
33
namespace
nfd
{
34
namespace
rib {
35
38
class
Route
39
{
40
public
:
41
Route
()
42
:
faceId
(0)
43
,
origin
(0)
44
,
flags
(0)
45
,
cost
(0)
46
,
expires
(
time
::steady_clock::TimePoint::min())
47
, m_expirationEvent()
48
{
49
}
50
51
bool
52
operator==
(
const
Route
& other)
const
;
53
54
public
:
55
void
56
setExpirationEvent
(
const
scheduler::EventId
eid)
57
{
58
m_expirationEvent = eid;
59
}
60
61
const
scheduler::EventId
&
62
getExpirationEvent
()
const
63
{
64
return
m_expirationEvent;
65
}
66
67
bool
68
isChildInherit
()
const
69
{
70
return
flags
&
ndn::nfd::ROUTE_FLAG_CHILD_INHERIT
;
71
}
72
73
bool
74
isCapture
()
const
75
{
76
return
flags
&
ndn::nfd::ROUTE_FLAG_CAPTURE
;
77
}
78
79
public
:
80
uint64_t
faceId
;
81
uint64_t
origin
;
82
uint64_t
flags
;
83
uint64_t
cost
;
84
time::steady_clock::TimePoint
expires
;
85
86
private
:
87
scheduler::EventId
m_expirationEvent;
88
};
89
90
inline
bool
91
compareFaceIdAndOrigin
(
const
Route
& lhs,
const
Route
& rhs)
92
{
93
return
(lhs.
faceId
== rhs.
faceId
&& lhs.
origin
== rhs.
origin
);
94
}
95
96
inline
bool
97
compareFaceId
(
const
Route
& route,
const
uint64_t
faceId
)
98
{
99
return
(route.
faceId
== faceId);
100
}
101
102
std::ostream&
103
operator<<
(std::ostream& os,
const
Route
& route);
104
105
}
// namespace rib
106
}
// namespace nfd
107
108
#endif // NFD_RIB_ROUTE_HPP
ndn::time::steady_clock::TimePoint
time_point TimePoint
Definition:
time.hpp:108
nfd::rib::Route::operator==
bool operator==(const Route &other) const
Definition:
route.cpp:32
nfd::rib::Route::getExpirationEvent
const scheduler::EventId & getExpirationEvent() const
Definition:
route.hpp:62
nfd::rib::Route::setExpirationEvent
void setExpirationEvent(const scheduler::EventId eid)
Definition:
route.hpp:56
nfd::rib::Route::expires
time::steady_clock::TimePoint expires
Definition:
route.hpp:84
nfd::rib::operator<<
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
Definition:
fib-update.hpp:74
nfd::rib::Route::Route
Route()
Definition:
route.hpp:41
nfd::rib::Route::isChildInherit
bool isChildInherit() const
Definition:
route.hpp:68
nfd::rib::Route::cost
uint64_t cost
Definition:
route.hpp:83
nfd::rib::Route::faceId
uint64_t faceId
Definition:
route.hpp:80
nfd::rib::compareFaceIdAndOrigin
bool compareFaceIdAndOrigin(const Route &lhs, const Route &rhs)
Definition:
route.hpp:91
ndn::time
Definition:
time-custom-clock.hpp:28
ndn::util::scheduler::EventId
std::shared_ptr< ns3::EventId > EventId
Definition:
scheduler.hpp:39
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::nfd::ROUTE_FLAG_CAPTURE
Definition:
nfd-constants.hpp:100
nfd::rib::Route::origin
uint64_t origin
Definition:
route.hpp:81
nfd::rib::Route
represents a route for a name prefix
Definition:
route.hpp:38
scheduler.hpp
nfd::rib::Route::flags
uint64_t flags
Definition:
route.hpp:82
nfd::rib::compareFaceId
bool compareFaceId(const Route &route, const uint64_t faceId)
Definition:
route.hpp:97
nfd::rib::Route::isCapture
bool isCapture() const
Definition:
route.hpp:74
ndn::nfd::ROUTE_FLAG_CHILD_INHERIT
Definition:
nfd-constants.hpp:99
ndnSIM
NFD
rib
route.hpp
Generated on Sat Nov 12 2016 16:02:54 for ndnSIM by
1.8.12