build: switch to C++17
Change-Id: Id6217b5c993f3e4726e89773128b565e5f136bb6
diff --git a/tools/ping/server/main.cpp b/tools/ping/server/main.cpp
index e81125c..bf050da 100644
--- a/tools/ping/server/main.cpp
+++ b/tools/ping/server/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2015-2021, Arizona Board of Regents.
+ * Copyright (c) 2015-2022, 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.
@@ -31,9 +31,7 @@
#include <boost/program_options/parsers.hpp>
#include <boost/program_options/variables_map.hpp>
-namespace ndn {
-namespace ping {
-namespace server {
+namespace ndn::ping::server {
namespace po = boost::program_options;
@@ -90,7 +88,7 @@
};
static void
-usage(std::ostream& os, const std::string& programName, const po::options_description& options)
+usage(std::ostream& os, std::string_view programName, const po::options_description& options)
{
os << "Usage: " << programName << " [options] <prefix>\n"
<< "\n"
@@ -187,9 +185,7 @@
return Runner(options).run();
}
-} // namespace server
-} // namespace ping
-} // namespace ndn
+} // namespace ndn::ping::server
int
main(int argc, char* argv[])
diff --git a/tools/ping/server/ping-server.cpp b/tools/ping/server/ping-server.cpp
index 5ceeb76..69093d3 100644
--- a/tools/ping/server/ping-server.cpp
+++ b/tools/ping/server/ping-server.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2015-2021, Arizona Board of Regents.
+ * Copyright (c) 2015-2022, 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.
@@ -24,15 +24,12 @@
#include <ndn-cxx/security/signing-helpers.hpp>
-namespace ndn {
-namespace ping {
-namespace server {
+namespace ndn::ping::server {
PingServer::PingServer(Face& face, KeyChain& keyChain, const Options& options)
: m_options(options)
, m_face(face)
, m_keyChain(keyChain)
- , m_nPings(0)
{
auto b = make_shared<Buffer>();
b->assign(m_options.payloadSize, 'a');
@@ -78,6 +75,4 @@
}
}
-} // namespace server
-} // namespace ping
-} // namespace ndn
+} // namespace ndn::ping::server
diff --git a/tools/ping/server/ping-server.hpp b/tools/ping/server/ping-server.hpp
index f13769c..e9127c0 100644
--- a/tools/ping/server/ping-server.hpp
+++ b/tools/ping/server/ping-server.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2015-2021, Arizona Board of Regents.
+ * Copyright (c) 2015-2022, 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.
@@ -27,9 +27,7 @@
#include <ndn-cxx/util/signal.hpp>
-namespace ndn {
-namespace ping {
-namespace server {
+namespace ndn::ping::server {
/**
* @brief Options for PingServer
@@ -105,13 +103,11 @@
const Options& m_options;
Face& m_face;
KeyChain& m_keyChain;
- size_t m_nPings;
+ size_t m_nPings = 0;
Block m_payload;
RegisteredPrefixHandle m_registeredPrefix;
};
-} // namespace server
-} // namespace ping
-} // namespace ndn
+} // namespace ndn::ping::server
#endif // NDN_TOOLS_PING_SERVER_PING_SERVER_HPP
diff --git a/tools/ping/server/tracer.cpp b/tools/ping/server/tracer.cpp
index c6b30b9..0a9df40 100644
--- a/tools/ping/server/tracer.cpp
+++ b/tools/ping/server/tracer.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2015-2021, Arizona Board of Regents.
+ * Copyright (c) 2015-2022, 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.
@@ -21,9 +21,7 @@
#include "tracer.hpp"
-namespace ndn {
-namespace ping {
-namespace server {
+namespace ndn::ping::server {
Tracer::Tracer(PingServer& pingServer, const Options& options)
: m_options(options)
@@ -38,6 +36,4 @@
}
}
-} // namespace server
-} // namespace ping
-} // namespace ndn
+} // namespace ndn::ping::server
diff --git a/tools/ping/server/tracer.hpp b/tools/ping/server/tracer.hpp
index a84b72e..e8aac85 100644
--- a/tools/ping/server/tracer.hpp
+++ b/tools/ping/server/tracer.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2015-2021, Arizona Board of Regents.
+ * Copyright (c) 2015-2022, 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.
@@ -26,9 +26,7 @@
#include "ping-server.hpp"
-namespace ndn {
-namespace ping {
-namespace server {
+namespace ndn::ping::server {
/**
* @brief Logs ping responses
@@ -42,8 +40,6 @@
const Options& m_options;
};
-} // namespace server
-} // namespace ping
-} // namespace ndn
+} // namespace ndn::ping::server
#endif // NDN_TOOLS_PING_SERVER_TRACER_HPP