Skip to content

Commit

Permalink
Avoid using deprecated ndn-cxx type aliases
Browse files Browse the repository at this point in the history
Change-Id: I55fd500377698adc8035113bdff2d64091a36e07
  • Loading branch information
Pesa committed May 11, 2023
1 parent 070ee3b commit 658fd85
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 56 deletions.
4 changes: 2 additions & 2 deletions src/hello-protocol.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -83,7 +83,7 @@ class HelloProtocol
void
processInterest(const ndn::Name& name, const ndn::Interest& interest);

ndn::util::signal::Signal<HelloProtocol, Statistics::PacketType> hpIncrementSignal;
ndn::util::Signal<HelloProtocol, Statistics::PacketType> hpIncrementSignal;

private:
/*! \brief Try to contact a neighbor via Hello protocol again
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/adj-lsa.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -25,7 +25,7 @@
namespace nlsr {

AdjLsa::AdjLsa(const ndn::Name& originRouter, uint64_t seqNo,
const ndn::time::system_clock::TimePoint& timepoint,
const ndn::time::system_clock::time_point& timepoint,
uint32_t noLink, AdjacencyList& adl)
: Lsa(originRouter, seqNo, timepoint)
, m_noLink(noLink)
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/adj-lsa.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2021, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -42,7 +42,7 @@ class AdjLsa : public Lsa
AdjLsa() = default;

AdjLsa(const ndn::Name& originR, uint64_t seqNo,
const ndn::time::system_clock::TimePoint& timepoint,
const ndn::time::system_clock::time_point& timepoint,
uint32_t noLink, AdjacencyList& adl);

AdjLsa(const ndn::Block& block);
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/coordinate-lsa.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -27,7 +27,7 @@
namespace nlsr {

CoordinateLsa::CoordinateLsa(const ndn::Name& originRouter, uint64_t seqNo,
const ndn::time::system_clock::TimePoint& timepoint,
const ndn::time::system_clock::time_point& timepoint,
double radius, std::vector<double> angles)
: Lsa(originRouter, seqNo, timepoint)
, m_hyperbolicRadius(radius)
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/coordinate-lsa.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2021, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -39,7 +39,7 @@ class CoordinateLsa : public Lsa
CoordinateLsa() = default;

CoordinateLsa(const ndn::Name& originRouter, uint64_t seqNo,
const ndn::time::system_clock::TimePoint& timepoint,
const ndn::time::system_clock::time_point& timepoint,
double radius, std::vector<double> angles);

CoordinateLsa(const ndn::Block& block);
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/lsa.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -28,7 +28,7 @@
namespace nlsr {

Lsa::Lsa(const ndn::Name& originRouter, uint64_t seqNo,
ndn::time::system_clock::TimePoint expirationTimePoint)
ndn::time::system_clock::time_point expirationTimePoint)
: m_originRouter(originRouter)
, m_seqNo(seqNo)
, m_expirationTimePoint(expirationTimePoint)
Expand Down
10 changes: 5 additions & 5 deletions src/lsa/lsa.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2021, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -56,7 +56,7 @@ class Lsa

protected:
Lsa(const ndn::Name& originRouter, uint64_t seqNo,
ndn::time::system_clock::TimePoint expirationTimePoint);
ndn::time::system_clock::time_point expirationTimePoint);

Lsa() = default;

Expand Down Expand Up @@ -94,14 +94,14 @@ class Lsa
return m_originRouter;
}

const ndn::time::system_clock::TimePoint&
const ndn::time::system_clock::time_point&
getExpirationTimePoint() const
{
return m_expirationTimePoint;
}

void
setExpirationTimePoint(const ndn::time::system_clock::TimePoint& lt)
setExpirationTimePoint(const ndn::time::system_clock::time_point& lt)
{
m_expirationTimePoint = lt;
m_wire.reset();
Expand Down Expand Up @@ -138,7 +138,7 @@ class Lsa
PUBLIC_WITH_TESTS_ELSE_PROTECTED:
ndn::Name m_originRouter;
uint64_t m_seqNo = 0;
ndn::time::system_clock::TimePoint m_expirationTimePoint;
ndn::time::system_clock::time_point m_expirationTimePoint;
ndn::scheduler::ScopedEventId m_expiringEventId;

mutable ndn::Block m_wire;
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/name-lsa.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand All @@ -25,7 +25,7 @@
namespace nlsr {

NameLsa::NameLsa(const ndn::Name& originRouter, uint64_t seqNo,
const ndn::time::system_clock::TimePoint& timepoint,
const ndn::time::system_clock::time_point& timepoint,
const NamePrefixList& npl)
: Lsa(originRouter, seqNo, timepoint)
{
Expand Down
4 changes: 2 additions & 2 deletions src/lsa/name-lsa.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2021, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -38,7 +38,7 @@ class NameLsa : public Lsa
NameLsa() = default;

NameLsa(const ndn::Name& originRouter, uint64_t seqNo,
const ndn::time::system_clock::TimePoint& timepoint,
const ndn::time::system_clock::time_point& timepoint,
const NamePrefixList& npl);

NameLsa(const ndn::Block& block);
Expand Down
6 changes: 3 additions & 3 deletions src/lsdb.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -408,7 +408,7 @@ Lsdb::expireOrRefreshLsa(std::shared_ptr<Lsa> lsa)

void
Lsdb::expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, uint64_t incomingFaceId,
ndn::time::steady_clock::TimePoint deadline)
ndn::time::steady_clock::time_point deadline)
{
// increment SENT_LSA_INTEREST
lsaIncrementSignal(Statistics::PacketType::SENT_LSA_INTEREST);
Expand Down Expand Up @@ -478,7 +478,7 @@ Lsdb::expressInterest(const ndn::Name& interestName, uint32_t timeoutCount, uint

void
Lsdb::onFetchLsaError(uint32_t errorCode, const std::string& msg, const ndn::Name& interestName,
uint32_t retransmitNo, const ndn::time::steady_clock::TimePoint& deadline,
uint32_t retransmitNo, const ndn::time::steady_clock::time_point& deadline,
ndn::Name lsaName, uint64_t seqNo)
{
NLSR_LOG_DEBUG("Failed to fetch LSA: " << lsaName << ", Error code: " << errorCode
Expand Down
4 changes: 2 additions & 2 deletions src/lsdb.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -48,7 +48,7 @@ namespace nlsr {

namespace bmi = boost::multi_index;

static constexpr ndn::time::seconds GRACE_PERIOD = 10_s;
inline constexpr ndn::time::seconds GRACE_PERIOD = 10_s;

enum class LsdbUpdate {
INSTALLED,
Expand Down
10 changes: 5 additions & 5 deletions src/publisher/dataset-interest-handler.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2021, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -30,10 +30,10 @@ namespace nlsr {

INIT_LOGGER(DatasetInterestHandler);

const ndn::PartialName ADJACENCIES_DATASET = ndn::PartialName("lsdb/adjacencies");
const ndn::PartialName COORDINATES_DATASET = ndn::PartialName("lsdb/coordinates");
const ndn::PartialName NAMES_DATASET = ndn::PartialName("lsdb/names");
const ndn::PartialName RT_DATASET = ndn::PartialName("routing-table");
const ndn::PartialName ADJACENCIES_DATASET{"lsdb/adjacencies"};
const ndn::PartialName COORDINATES_DATASET{"lsdb/coordinates"};
const ndn::PartialName NAMES_DATASET{"lsdb/names"};
const ndn::PartialName RT_DATASET{"routing-table"};

DatasetInterestHandler::DatasetInterestHandler(ndn::mgmt::Dispatcher& dispatcher,
const Lsdb& lsdb,
Expand Down
14 changes: 7 additions & 7 deletions src/route/routing-table-calculator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -35,12 +35,12 @@ namespace nlsr {

INIT_LOGGER(route.RoutingTableCalculator);

const int EMPTY_PARENT = -12345;
const double INF_DISTANCE = 2147483647;
const int NO_MAPPING_NUM = -1;
const int NO_NEXT_HOP = -12345;
const double UNKNOWN_DISTANCE = -1.0;
const double UNKNOWN_RADIUS = -1.0;
constexpr int EMPTY_PARENT = -12345;
constexpr double INF_DISTANCE = 2147483647;
constexpr int NO_MAPPING_NUM = -1;
constexpr int NO_NEXT_HOP = -12345;
constexpr double UNKNOWN_DISTANCE = -1.0;
constexpr double UNKNOWN_RADIUS = -1.0;

void
RoutingTableCalculator::allocateAdjMatrix()
Expand Down
5 changes: 3 additions & 2 deletions tests/route/test-hyperbolic-calculator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -35,7 +35,8 @@ namespace test {

using std::shared_ptr;
using ndn::time::system_clock;
static const system_clock::TimePoint MAX_TIME = system_clock::TimePoint::max();

constexpr system_clock::time_point MAX_TIME = system_clock::time_point::max();

class HyperbolicCalculatorFixture : public IoKeyChainFixture
{
Expand Down
5 changes: 2 additions & 3 deletions tests/route/test-link-state-calculator.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -34,8 +34,7 @@
namespace nlsr {
namespace test {

static const ndn::time::system_clock::TimePoint MAX_TIME =
ndn::time::system_clock::TimePoint::max();
constexpr ndn::time::system_clock::time_point MAX_TIME = ndn::time::system_clock::time_point::max();

class LinkStateCalculatorFixture : public IoKeyChainFixture
{
Expand Down
4 changes: 2 additions & 2 deletions tests/route/test-name-prefix-table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -315,7 +315,7 @@ BOOST_FIXTURE_TEST_CASE(RoutingTableUpdate, NamePrefixTableFixture)

BOOST_FIXTURE_TEST_CASE(UpdateFromLsdb, NamePrefixTableFixture)
{
ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now();
auto testTimePoint = ndn::time::system_clock::now();
NamePrefixList npl1;
ndn::Name n1("name1");
ndn::Name n2("name2");
Expand Down
4 changes: 2 additions & 2 deletions tests/route/test-routing-table.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California
*
* This file is part of NLSR (Named-data Link State Routing).
Expand Down Expand Up @@ -118,7 +118,7 @@ BOOST_FIXTURE_TEST_CASE(OutputStream, RoutingTableFixture)

BOOST_FIXTURE_TEST_CASE(UpdateFromLsdb, RoutingTableFixture)
{
ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now() + 3600_s;
auto testTimePoint = ndn::time::system_clock::now() + 3600_s;
ndn::Name router2("/router2");
AdjLsa adjLsa(router2, 12, testTimePoint, 2, conf.getAdjacencyList());
std::shared_ptr<Lsa> lsaPtr = std::make_shared<AdjLsa>(adjLsa);
Expand Down
11 changes: 5 additions & 6 deletions tests/test-lsdb.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022, The University of Memphis,
* Copyright (c) 2014-2023, The University of Memphis,
* Regents of the University of California,
* Arizona Board of Regents.
*
Expand Down Expand Up @@ -147,8 +147,7 @@ BOOST_AUTO_TEST_CASE(LsdbSync)
BOOST_CHECK(didFindInterest);
interests.clear();

ndn::time::steady_clock::TimePoint deadline = ndn::time::steady_clock::now() +
ndn::time::seconds(LSA_REFRESH_TIME_MAX);
auto deadline = ndn::time::steady_clock::now() + ndn::time::seconds(LSA_REFRESH_TIME_MAX);

// Simulate an LSA interest timeout
lsdb.onFetchLsaError(ndn::util::SegmentFetcher::ErrorCode::INTEREST_TIMEOUT, "Timeout",
Expand Down Expand Up @@ -299,7 +298,7 @@ BOOST_AUTO_TEST_CASE(ReceiveSegmentedLsaData)

BOOST_AUTO_TEST_CASE(LsdbRemoveAndExists)
{
ndn::time::system_clock::TimePoint testTimePoint = ndn::time::system_clock::now();
auto testTimePoint = ndn::time::system_clock::now();
NamePrefixList npl1;

std::string s1 = "name1";
Expand Down Expand Up @@ -336,7 +335,7 @@ BOOST_AUTO_TEST_CASE(InstallNameLsa)
prefixes.insert(name2);

std::string otherRouter("/ndn/site/%C1.router/other-router");
ndn::time::system_clock::TimePoint MAX_TIME = ndn::time::system_clock::TimePoint::max();
const auto MAX_TIME = ndn::time::system_clock::time_point::max();

NameLsa lsa(otherRouter, 1, MAX_TIME, prefixes);
lsdb.installLsa(std::make_shared<NameLsa>(lsa));
Expand Down Expand Up @@ -397,7 +396,7 @@ BOOST_AUTO_TEST_CASE(TestIsLsaNew)

// Install Name LSA
NamePrefixList nameList;
NameLsa lsa(originRouter, 999, ndn::time::system_clock::TimePoint::max(), nameList);
NameLsa lsa(originRouter, 999, ndn::time::system_clock::time_point::max(), nameList);

lsdb.installLsa(std::make_shared<NameLsa>(lsa));

Expand Down
Loading

0 comments on commit 658fd85

Please sign in to comment.