Switch to Face::getIoContext()
Change-Id: I34bb49dc96e91e6f0ff8f9be9185949df3a9739c
diff --git a/tests/clock-fixture.cpp b/tests/clock-fixture.cpp
index 472e489..765511c 100644
--- a/tests/clock-fixture.cpp
+++ b/tests/clock-fixture.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,13 +26,11 @@
#include "clock-fixture.hpp"
-namespace ndn {
-namespace ndns {
-namespace tests {
+namespace ndn::ndns::tests {
ClockFixture::ClockFixture()
- : m_steadyClock(make_shared<time::UnitTestSteadyClock>())
- , m_systemClock(make_shared<time::UnitTestSystemClock>())
+ : m_steadyClock(std::make_shared<time::UnitTestSteadyClock>())
+ , m_systemClock(std::make_shared<time::UnitTestSystemClock>())
{
time::setCustomClocks(m_steadyClock, m_systemClock);
}
@@ -58,6 +56,4 @@
}
}
-} // namespace tests
-} // namespace ndns
-} // namespace ndn
+} // namespace ndn::ndns::tests
diff --git a/tests/clock-fixture.hpp b/tests/clock-fixture.hpp
index 48a0f73..9cbc16e 100644
--- a/tests/clock-fixture.hpp
+++ b/tests/clock-fixture.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California,
+ * Copyright (c) 2014-2024, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,9 +29,7 @@
#include <ndn-cxx/util/time-unit-test-clock.hpp>
-namespace ndn {
-namespace ndns {
-namespace tests {
+namespace ndn::ndns::tests {
/** \brief A test fixture that overrides steady clock and system clock.
*/
@@ -81,12 +79,10 @@
}
protected:
- shared_ptr<time::UnitTestSteadyClock> m_steadyClock;
- shared_ptr<time::UnitTestSystemClock> m_systemClock;
+ std::shared_ptr<time::UnitTestSteadyClock> m_steadyClock;
+ std::shared_ptr<time::UnitTestSystemClock> m_systemClock;
};
-} // namespace tests
-} // namespace ndns
-} // namespace ndn
+} // namespace ndn::ndns::tests
#endif // NDNS_TESTS_CLOCK_FIXTURE_HPP
diff --git a/tests/unit/daemon/name-server.t.cpp b/tests/unit/daemon/name-server.t.cpp
index 59c9197..63b1576 100644
--- a/tests/unit/daemon/name-server.t.cpp
+++ b/tests/unit/daemon/name-server.t.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2023, Regents of the University of California.
+ * Copyright (c) 2014-2024, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -50,8 +50,8 @@
void
run()
{
- face.getIoService().poll();
- face.getIoService().reset();
+ face.getIoContext().poll();
+ face.getIoContext().reset();
}
public:
diff --git a/tools/ndns-dig.cpp b/tools/ndns-dig.cpp
index 88340d9..0bb9d0b 100644
--- a/tools/ndns-dig.cpp
+++ b/tools/ndns-dig.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2020, Regents of the University of California.
+ * Copyright (c) 2014-2024, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -86,7 +86,7 @@
void
stop()
{
- m_face.getIoService().stop();
+ m_face.getIoContext().stop();
NDNS_LOG_TRACE("application stops.");
}
diff --git a/tools/ndns-update.cpp b/tools/ndns-update.cpp
index 5bdf6fb..ed947de 100644
--- a/tools/ndns-update.cpp
+++ b/tools/ndns-update.cpp
@@ -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-2024, Regents of the University of California.
*
* This file is part of NDNS (Named Data Networking Domain Name Service).
* See AUTHORS.md for complete list of NDNS authors and contributors.
@@ -79,7 +79,7 @@
void
stop()
{
- m_face.getIoService().stop();
+ m_face.getIoContext().stop();
}
private:
diff --git a/wscript b/wscript
index 435fbd0..86973be 100644
--- a/wscript
+++ b/wscript
@@ -1,7 +1,8 @@
# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+import os
+import subprocess
from waflib import Context, Logs, Utils
-import os, subprocess
VERSION = '0.1'
APPNAME = 'ndns'
@@ -33,12 +34,12 @@
conf.find_program(['pkgconf', 'pkg-config'], var='PKGCONFIG')
pkg_config_path = os.environ.get('PKG_CONFIG_PATH', f'{conf.env.LIBDIR}/pkgconfig')
- conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.0', '--cflags', '--libs'],
+ conf.check_cfg(package='libndn-cxx', args=['libndn-cxx >= 0.8.1', '--cflags', '--libs'],
uselib_store='NDN_CXX', pkg_config_path=pkg_config_path)
conf.check_sqlite3()
- boost_libs = ['system', 'program_options', 'filesystem']
+ boost_libs = ['filesystem', 'program_options']
if conf.env.WITH_TESTS:
boost_libs.append('unit_test_framework')
@@ -94,7 +95,7 @@
if Utils.unversioned_sys_platform() == 'linux':
bld(features='subst',
- name='ndns.service',
+ name='systemd-units',
source='systemd/ndns.service.in',
target='systemd/ndns.service')
@@ -160,16 +161,16 @@
# first, try to get a version string from git
gotVersionFromGit = False
try:
- cmd = ['git', 'describe', '--always', '--match', '%s*' % GIT_TAG_PREFIX]
- out = subprocess.check_output(cmd, universal_newlines=True).strip()
+ cmd = ['git', 'describe', '--always', '--match', f'{GIT_TAG_PREFIX}*']
+ out = subprocess.run(cmd, capture_output=True, check=True, text=True).stdout.strip()
if out:
gotVersionFromGit = True
if out.startswith(GIT_TAG_PREFIX):
Context.g_module.VERSION = out.lstrip(GIT_TAG_PREFIX)
else:
# no tags matched
- Context.g_module.VERSION = '%s-commit-%s' % (VERSION_BASE, out)
- except (OSError, subprocess.CalledProcessError):
+ Context.g_module.VERSION = f'{VERSION_BASE}-commit-{out}'
+ except (OSError, subprocess.SubprocessError):
pass
versionFile = ctx.path.find_node('VERSION.info')
@@ -187,14 +188,14 @@
# already up-to-date
return
except EnvironmentError as e:
- Logs.warn('%s exists but is not readable (%s)' % (versionFile, e.strerror))
+ Logs.warn(f'{versionFile} exists but is not readable ({e.strerror})')
else:
versionFile = ctx.path.make_node('VERSION.info')
try:
versionFile.write(Context.g_module.VERSION)
except EnvironmentError as e:
- Logs.warn('%s is not writable (%s)' % (versionFile, e.strerror))
+ Logs.warn(f'{versionFile} is not writable ({e.strerror})')
def dist(ctx):
ctx.algo = 'tar.xz'