NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
route.cpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#include "
route.hpp
"
27
#include <ndn-cxx/util/string-helper.hpp>
28
29
namespace
nfd
{
30
namespace
rib {
31
32
Route::Route
()
33
: faceId(0)
34
, origin(
ndn
::
nfd
::
ROUTE_ORIGIN_APP
)
35
, cost(0)
36
, flags(
ndn
::
nfd
::
ROUTE_FLAGS_NONE
)
37
{
38
}
39
40
bool
41
operator==
(
const
Route
& lhs,
const
Route
& rhs)
42
{
43
return
lhs.
faceId
== rhs.
faceId
&&
44
lhs.
origin
== rhs.
origin
&&
45
lhs.
flags
== rhs.
flags
&&
46
lhs.
cost
== rhs.
cost
&&
47
lhs.
expires
== rhs.
expires
;
48
}
49
50
std::ostream&
51
operator<<
(std::ostream& os,
const
Route
& route)
52
{
53
os <<
"Route("
54
<<
"faceid: "
<< route.
faceId
55
<<
", origin: "
<< route.
origin
56
<<
", cost: "
<< route.
cost
57
<<
", flags: "
<<
ndn::AsHex
{route.
flags
};
58
if
(route.
expires
) {
59
os <<
", expires in: "
<< time::duration_cast<time::milliseconds>(*route.
expires
-
time::steady_clock::now
());
60
}
61
else
{
62
os <<
", never expires"
;
63
}
64
os <<
")"
;
65
66
return
os;
67
}
68
69
}
// namespace rib
70
}
// namespace nfd
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
nfd::rib::operator==
bool operator==(const Route &lhs, const Route &rhs)
Definition:
route.cpp:41
ndn::time::steady_clock::now
static time_point now() noexcept
Definition:
time.cpp:80
nfd::rib::operator<<
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
Definition:
fib-update.hpp:74
ndn::nfd::ROUTE_ORIGIN_APP
Definition:
nfd-constants.hpp:101
nfd::rib::Route::Route
Route()
Definition:
route.cpp:32
nfd::rib::Route::flags
std::underlying_type< ndn::nfd::RouteFlags >::type flags
Definition:
route.hpp:68
ndn::AsHex
Helper class to convert a number to hexadecimal format, for use with stream insertion operators...
Definition:
string-helper.hpp:52
nfd::rib::Route::cost
uint64_t cost
Definition:
route.hpp:67
nfd::rib::Route::faceId
uint64_t faceId
Definition:
route.hpp:65
nfd::rib::Route::expires
optional< time::steady_clock::TimePoint > expires
Definition:
route.hpp:69
ndn::nfd::ROUTE_FLAGS_NONE
Definition:
nfd-constants.hpp:124
nfd::rib::Route::origin
ndn::nfd::RouteOrigin origin
Definition:
route.hpp:66
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
nfd::rib::Route
represents a route for a name prefix
Definition:
route.hpp:41
route.hpp
ndnSIM
NFD
rib
route.cpp
Generated on Tue Aug 7 2018 16:19:18 for ndnSIM by
1.8.14