NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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 
28 namespace nfd {
29 namespace rib {
30 
31 bool
32 Route::operator==(const Route& other) const
33 {
34  return (this->faceId == other.faceId &&
35  this->origin == other.origin &&
36  this->flags == other.flags &&
37  this->cost == other.cost &&
38  this->expires == other.expires);
39 }
40 
41 std::ostream&
42 operator<<(std::ostream& os, const Route& route)
43 {
44  os << "Route("
45  << "faceid: " << route.faceId
46  << ", origin: " << route.origin
47  << ", cost: " << route.cost
48  << ", flags: " << route.flags;
49  if (route.expires != time::steady_clock::TimePoint::max()) {
50  os << ", expires in: " << (route.expires - time::steady_clock::now());
51  }
52  else {
53  os << ", never expires";
54  }
55  os << ")";
56 
57  return os;
58 }
59 
60 } // namespace rib
61 } // namespace nfd
time::steady_clock::TimePoint expires
Definition: route.hpp:83
static time_point now() noexcept
Definition: time.cpp:79
std::ostream & operator<<(std::ostream &os, const FibUpdate &update)
Definition: fib-update.hpp:74
uint64_t cost
Definition: route.hpp:82
uint64_t faceId
Definition: route.hpp:79
bool operator==(const Route &other) const
Definition: route.cpp:32
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:38
uint64_t origin
Definition: route.hpp:80
represents a route for a name prefix
Definition: route.hpp:37
uint64_t flags
Definition: route.hpp:81