Skip to content

Commit

Permalink
Switch to Face::getIoContext()
Browse files Browse the repository at this point in the history
Change-Id: Ice05b0b8e9af4ed4651abcf6fc4ea6b84c34da7c
  • Loading branch information
Pesa committed Nov 11, 2023
1 parent 816767b commit 7e9d7e4
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .waf-tools/default-compiler-flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ def getCompilerVersion(self, conf):

def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
return {
'CXXFLAGS': [],
'LINKFLAGS': [],
'DEFINES': ['BOOST_ASIO_NO_DEPRECATED', 'BOOST_FILESYSTEM_NO_DEPRECATED'],
}

def getDebugFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in debug mode"""
Expand Down
3 changes: 2 additions & 1 deletion tests/dump/ndndump.t.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, University of Memphis,
* Copyright (c) 2014-2023, University of Memphis,
* University Pierre & Marie Curie, Sorbonne University.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
Expand Down Expand Up @@ -32,6 +32,7 @@
#include <boost/test/tools/output_test_stream.hpp>

#include <ndn-cxx/encoding/encoding-buffer.hpp>
#include <ndn-cxx/lp/fields.hpp>
#include <ndn-cxx/lp/packet.hpp>
#include <ndn-cxx/net/ethernet.hpp>

Expand Down
4 changes: 2 additions & 2 deletions tools/chunks/catchunks/data-fetcher.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) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
Expand Down Expand Up @@ -50,7 +50,7 @@ DataFetcher::DataFetcher(Face& face, int maxNackRetries, int maxTimeoutRetries,
DataCallback onData, FailureCallback onNack, FailureCallback onTimeout,
bool isVerbose)
: m_face(face)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
, m_onData(std::move(onData))
, m_onNack(std::move(onNack))
, m_onTimeout(std::move(onTimeout))
Expand Down
5 changes: 2 additions & 3 deletions tools/chunks/catchunks/pipeline-interests-adaptive.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) 2016-2022, Regents of the University of California,
* Copyright (c) 2016-2023, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
Expand Down Expand Up @@ -29,7 +29,6 @@
#include "pipeline-interests-adaptive.hpp"
#include "data-fetcher.hpp"

#include <cmath>
#include <iomanip>

namespace ndn::chunks {
Expand All @@ -41,7 +40,7 @@ PipelineInterestsAdaptive::PipelineInterestsAdaptive(Face& face,
, m_cwnd(m_options.initCwnd)
, m_ssthresh(m_options.initSsthresh)
, m_rttEstimator(rttEstimator)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
}

Expand Down
2 changes: 1 addition & 1 deletion tools/chunks/catchunks/pipeline-interests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ PipelineInterests::onFailure(const std::string& reason)
cancel();

if (m_onFailure) {
boost::asio::post(m_face.getIoService(), [this, reason] { m_onFailure(reason); });
boost::asio::post(m_face.getIoContext(), [this, reason] { m_onFailure(reason); });
}
}

Expand Down
3 changes: 2 additions & 1 deletion tools/dump/ndndump.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) 2011-2022, Regents of the University of California.
* Copyright (c) 2011-2023, Regents of the University of California.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
Expand Down Expand Up @@ -31,6 +31,7 @@
#include <iomanip>
#include <sstream>

#include <ndn-cxx/lp/fields.hpp>
#include <ndn-cxx/lp/nack.hpp>
#include <ndn-cxx/lp/packet.hpp>
#include <ndn-cxx/net/ethernet.hpp>
Expand Down
4 changes: 2 additions & 2 deletions tools/peek/ndnpeek/ndnpeek.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, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -34,7 +34,7 @@ namespace ndn::peek {
NdnPeek::NdnPeek(Face& face, const PeekOptions& options)
: m_options(options)
, m_face(face)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
}

Expand Down
4 changes: 2 additions & 2 deletions tools/peek/ndnpoke/ndnpoke.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, Regents of the University of California,
* Copyright (c) 2014-2023, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
Expand Down Expand Up @@ -37,7 +37,7 @@ NdnPoke::NdnPoke(Face& face, KeyChain& keyChain, std::istream& input, const Poke
, m_face(face)
, m_keyChain(keyChain)
, m_input(input)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
}

Expand Down
6 changes: 3 additions & 3 deletions tools/ping/client/main.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, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
Expand Down Expand Up @@ -42,8 +42,8 @@ class Runner : noncopyable
: m_ping(m_face, options)
, m_statisticsCollector(m_ping, options)
, m_tracer(m_ping, options)
, m_signalSetInt(m_face.getIoService(), SIGINT)
, m_signalSetQuit(m_face.getIoService(), SIGQUIT)
, m_signalSetInt(m_face.getIoContext(), SIGINT)
, m_signalSetQuit(m_face.getIoContext(), SIGQUIT)
{
m_signalSetInt.async_wait([this] (const auto& err, int) { onInterruptSignal(err); });
m_signalSetQuit.async_wait([this] (const auto& err, int) { onQuitSignal(err); });
Expand Down
4 changes: 2 additions & 2 deletions tools/ping/client/ping.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, Arizona Board of Regents.
* Copyright (c) 2014-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
Expand Down Expand Up @@ -31,7 +31,7 @@ Ping::Ping(Face& face, const Options& options)
: m_options(options)
, m_nextSeq(options.startSeq)
, m_face(face)
, m_scheduler(m_face.getIoService())
, m_scheduler(m_face.getIoContext())
{
if (m_options.shouldGenerateRandomSeq) {
m_nextSeq = random::generateWord64();
Expand Down
4 changes: 2 additions & 2 deletions tools/ping/server/main.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) 2015-2022, Arizona Board of Regents.
* Copyright (c) 2015-2023, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
Expand Down Expand Up @@ -43,7 +43,7 @@ class Runner : noncopyable
: m_options(options)
, m_pingServer(m_face, m_keyChain, options)
, m_tracer(m_pingServer, options)
, m_signalSet(m_face.getIoService(), SIGINT)
, m_signalSet(m_face.getIoContext(), SIGINT)
{
m_pingServer.afterFinish.connect([this] {
m_pingServer.stop();
Expand Down

0 comments on commit 7e9d7e4

Please sign in to comment.