Cleanup includes in common.hpp
Change-Id: I1bb08a44726de5c880e6bc2f016506e6083e919b
diff --git a/tools/chunks/catchunks/consumer.hpp b/tools/chunks/catchunks/consumer.hpp
index 9972d76..3f6f77e 100644
--- a/tools/chunks/catchunks/consumer.hpp
+++ b/tools/chunks/catchunks/consumer.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2020, Regents of the University of California,
+ * Copyright (c) 2016-2021, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -34,6 +34,8 @@
#include <ndn-cxx/security/validation-error.hpp>
#include <ndn-cxx/security/validator.hpp>
+#include <map>
+
namespace ndn {
namespace chunks {
diff --git a/tools/chunks/catchunks/discover-version.hpp b/tools/chunks/catchunks/discover-version.hpp
index aaf409a..62a5e42 100644
--- a/tools/chunks/catchunks/discover-version.hpp
+++ b/tools/chunks/catchunks/discover-version.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2019, Regents of the University of California,
+ * Copyright (c) 2016-2021, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -31,6 +31,8 @@
#include "options.hpp"
+#include <ndn-cxx/util/signal.hpp>
+
namespace ndn {
namespace chunks {
@@ -44,23 +46,19 @@
*/
class DiscoverVersion
{
-public: // signals
- /**
- * @brief Signal emitted when the versioned name of Data is found.
- */
- signal::Signal<DiscoverVersion, Name> onDiscoverySuccess;
-
- /**
- * @brief Signal emitted when a failure occurs.
- */
- signal::Signal<DiscoverVersion, std::string> onDiscoveryFailure;
-
public:
DiscoverVersion(Face& face, const Name& prefix, const Options& options);
/**
- * @brief identify the latest Data version published.
+ * @brief Signal emitted when the versioned name of Data is found.
*/
+ util::Signal<DiscoverVersion, Name> onDiscoverySuccess;
+
+ /**
+ * @brief Signal emitted when a failure occurs.
+ */
+ util::Signal<DiscoverVersion, std::string> onDiscoveryFailure;
+
void
run();
diff --git a/tools/chunks/catchunks/main.cpp b/tools/chunks/catchunks/main.cpp
index cfb4124..faa7ed6 100644
--- a/tools/chunks/catchunks/main.cpp
+++ b/tools/chunks/catchunks/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2020, Regents of the University of California,
+ * Copyright (c) 2016-2021, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -40,6 +40,10 @@
#include <fstream>
#include <ndn-cxx/security/validator-null.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
+
namespace ndn {
namespace chunks {
diff --git a/tools/chunks/catchunks/pipeline-interests-adaptive.hpp b/tools/chunks/catchunks/pipeline-interests-adaptive.hpp
index 914143c..158656e 100644
--- a/tools/chunks/catchunks/pipeline-interests-adaptive.hpp
+++ b/tools/chunks/catchunks/pipeline-interests-adaptive.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2019, Regents of the University of California,
+ * Copyright (c) 2016-2021, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -32,6 +32,7 @@
#include "pipeline-interests.hpp"
#include <ndn-cxx/util/rtt-estimator.hpp>
+#include <ndn-cxx/util/signal.hpp>
#include <queue>
#include <unordered_map>
@@ -94,7 +95,7 @@
* The callback function should be: `void(nanoseconds age, double cwnd)`, where `age` is the
* time since the pipeline started and `cwnd` is the new congestion window size (in segments).
*/
- signal::Signal<PipelineInterestsAdaptive, time::nanoseconds, double> afterCwndChange;
+ util::Signal<PipelineInterestsAdaptive, time::nanoseconds, double> afterCwndChange;
struct RttSample
{
@@ -108,7 +109,7 @@
/**
* @brief Signals when a new RTT sample has been taken.
*/
- signal::Signal<PipelineInterestsAdaptive, RttSample> afterRttMeasurement;
+ util::Signal<PipelineInterestsAdaptive, RttSample> afterRttMeasurement;
protected:
DECLARE_SIGNAL_EMIT(afterCwndChange)
diff --git a/tools/chunks/catchunks/pipeline-interests.cpp b/tools/chunks/catchunks/pipeline-interests.cpp
index ad8b818..9f2e3b5 100644
--- a/tools/chunks/catchunks/pipeline-interests.cpp
+++ b/tools/chunks/catchunks/pipeline-interests.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2019, Regents of the University of California,
+ * Copyright (c) 2016-2021, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -31,6 +31,8 @@
#include "pipeline-interests.hpp"
#include "data-fetcher.hpp"
+#include <boost/asio/io_service.hpp>
+
namespace ndn {
namespace chunks {
diff --git a/tools/chunks/putchunks/main.cpp b/tools/chunks/putchunks/main.cpp
index 5e1dd9f..e1b0ea5 100644
--- a/tools/chunks/putchunks/main.cpp
+++ b/tools/chunks/putchunks/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2016-2019, Regents of the University of California,
+ * Copyright (c) 2016-2021, Regents of the University of California,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University.
*
@@ -30,11 +30,15 @@
#include "core/version.hpp"
#include "producer.hpp"
-namespace po = boost::program_options;
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
namespace ndn {
namespace chunks {
+namespace po = boost::program_options;
+
static void
usage(std::ostream& os, const std::string& programName, const po::options_description& desc)
{
diff --git a/tools/dissect/main.cpp b/tools/dissect/main.cpp
index a2a7034..fb14692 100644
--- a/tools/dissect/main.cpp
+++ b/tools/dissect/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California.
+ * Copyright (c) 2014-2021, 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.
@@ -21,16 +21,16 @@
#include "core/version.hpp"
#include <boost/program_options/options_description.hpp>
-#include <boost/program_options/variables_map.hpp>
#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
#include <fstream>
-namespace po = boost::program_options;
-
namespace ndn {
namespace dissect {
+namespace po = boost::program_options;
+
static void
usage(std::ostream& os, const std::string& appName, const po::options_description& options)
{
@@ -43,34 +43,27 @@
static int
main(int argc, char* argv[])
{
+ std::string inputFileName;
+
po::options_description visibleOptions;
visibleOptions.add_options()
- ("help,h", "Print help and exit.")
- ("version,V", "Print version and exit.")
+ ("help,h", "print help and exit")
+ ("version,V", "print version and exit")
;
- std::string inputFileName;
po::options_description hiddenOptions;
hiddenOptions.add_options()
("input-file", po::value<std::string>(&inputFileName));
- ;
- po::positional_options_description positionalArguments;
- positionalArguments
- .add("input-file", -1);
po::options_description allOptions;
- allOptions
- .add(visibleOptions)
- .add(hiddenOptions)
- ;
+ allOptions.add(visibleOptions).add(hiddenOptions);
+
+ po::positional_options_description pos;
+ pos.add("input-file", -1);
po::variables_map vm;
try {
- po::store(po::command_line_parser(argc, argv)
- .options(allOptions)
- .positional(positionalArguments)
- .run(),
- vm);
+ po::store(po::command_line_parser(argc, argv).options(allOptions).positional(pos).run(), vm);
po::notify(vm);
}
catch (const po::error& e) {
diff --git a/tools/dissect/ndn-dissect.cpp b/tools/dissect/ndn-dissect.cpp
index c072c69..907eef6 100644
--- a/tools/dissect/ndn-dissect.cpp
+++ b/tools/dissect/ndn-dissect.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2019, Regents of the University of California.
+ * Copyright (c) 2013-2021, 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.
@@ -24,6 +24,7 @@
#include "ndn-dissect.hpp"
#include <algorithm>
+#include <map>
#include <ndn-cxx/name-component.hpp>
#include <ndn-cxx/encoding/tlv.hpp>
diff --git a/tools/dump/main.cpp b/tools/dump/main.cpp
index 86a9a85..49ea5b0 100644
--- a/tools/dump/main.cpp
+++ b/tools/dump/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2011-2019, Regents of the University of California.
+ * Copyright (c) 2011-2021, 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.
@@ -22,6 +22,10 @@
#include <ndn-cxx/util/ostream-joiner.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
+
#include <sstream>
namespace ndn {
diff --git a/tools/peek/ndnpeek/main.cpp b/tools/peek/ndnpeek/main.cpp
index 5a8bc19..ff9f2af 100644
--- a/tools/peek/ndnpeek/main.cpp
+++ b/tools/peek/ndnpeek/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,6 +32,10 @@
#include <ndn-cxx/util/io.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
+
#include <cerrno>
#include <cstring>
#include <fstream>
diff --git a/tools/peek/ndnpoke/main.cpp b/tools/peek/ndnpoke/main.cpp
index 00686ff..482cf80 100644
--- a/tools/peek/ndnpoke/main.cpp
+++ b/tools/peek/ndnpoke/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Regents of the University of California,
+ * Copyright (c) 2014-2021, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,6 +29,10 @@
#include "ndnpoke.hpp"
#include "core/version.hpp"
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
+
namespace ndn {
namespace peek {
diff --git a/tools/ping/client/main.cpp b/tools/ping/client/main.cpp
index 76d72ff..590c2db 100644
--- a/tools/ping/client/main.cpp
+++ b/tools/ping/client/main.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2019, Arizona Board of Regents.
+ * Copyright (c) 2014-2021, 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,6 +27,11 @@
#include "statistics-collector.hpp"
#include "tracer.hpp"
+#include <boost/asio/signal_set.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
+
namespace ndn {
namespace ping {
namespace client {
diff --git a/tools/ping/client/ping.hpp b/tools/ping/client/ping.hpp
index aeab96f..48f2485 100644
--- a/tools/ping/client/ping.hpp
+++ b/tools/ping/client/ping.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2015-2019, Arizona Board of Regents.
+ * Copyright (c) 2015-2021, 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,6 +26,8 @@
#include "core/common.hpp"
+#include <ndn-cxx/util/signal.hpp>
+
namespace ndn {
namespace ping {
namespace client {
@@ -62,7 +64,7 @@
* @param seq ping sequence number
* @param rtt round trip time
*/
- signal::Signal<Ping, uint64_t, Rtt> afterData;
+ util::Signal<Ping, uint64_t, Rtt> afterData;
/**
* @brief Signals on the return of a Nack
@@ -71,19 +73,19 @@
* @param rtt round trip time
* @param header the received Network NACK header
*/
- signal::Signal<Ping, uint64_t, Rtt, lp::NackHeader> afterNack;
+ util::Signal<Ping, uint64_t, Rtt, lp::NackHeader> afterNack;
/**
* @brief Signals on timeout of a packet
*
* @param seq ping sequence number
*/
- signal::Signal<Ping, uint64_t> afterTimeout;
+ util::Signal<Ping, uint64_t> afterTimeout;
/**
* @brief Signals when finished pinging
*/
- signal::Signal<Ping> afterFinish;
+ util::Signal<Ping> afterFinish;
/**
* @brief Start sending ping interests
diff --git a/tools/ping/server/main.cpp b/tools/ping/server/main.cpp
index dcce849..d43f1d2 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-2019, Arizona Board of Regents.
+ * Copyright (c) 2015-2021, 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,6 +26,11 @@
#include "ping-server.hpp"
#include "tracer.hpp"
+#include <boost/asio/signal_set.hpp>
+#include <boost/program_options/options_description.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <boost/program_options/variables_map.hpp>
+
namespace ndn {
namespace ping {
namespace server {
diff --git a/tools/ping/server/ping-server.hpp b/tools/ping/server/ping-server.hpp
index 46df6f9..f13769c 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-2019, Arizona Board of Regents.
+ * Copyright (c) 2015-2021, 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.
@@ -25,6 +25,8 @@
#include "core/common.hpp"
+#include <ndn-cxx/util/signal.hpp>
+
namespace ndn {
namespace ping {
namespace server {
@@ -55,12 +57,12 @@
*
* @param name incoming interest name
*/
- signal::Signal<PingServer, Name> afterReceive;
+ util::Signal<PingServer, Name> afterReceive;
/**
* @brief Signals when finished pinging
*/
- signal::Signal<PingServer> afterFinish;
+ util::Signal<PingServer> afterFinish;
/** @brief starts ping server
*