Refactor and modernize namespace declarations
Move all unit tests to namespace nfd::tests
Delete unused header core/algorithm.hpp
Change-Id: I5591f0c5f3bb5db67f8b45fae95471f8a555ca68
diff --git a/daemon/face/channel.cpp b/daemon/face/channel.cpp
index dd3b118..fa25405 100644
--- a/daemon/face/channel.cpp
+++ b/daemon/face/channel.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "channel.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
Channel::~Channel() = default;
@@ -53,5 +52,4 @@
});
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/channel.hpp b/daemon/face/channel.hpp
index f486feb..8d624fb 100644
--- a/daemon/face/channel.hpp
+++ b/daemon/face/channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "channel-log.hpp"
#include "face-common.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Represents a channel that listens on a local endpoint.
* \sa FaceSystem
@@ -99,7 +98,6 @@
void
connectFaceClosedSignal(Face& face, std::function<void()> f);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_CHANNEL_HPP
diff --git a/daemon/face/datagram-transport.hpp b/daemon/face/datagram-transport.hpp
index 950a49f..e053af2 100644
--- a/daemon/face/datagram-transport.hpp
+++ b/daemon/face/datagram-transport.hpp
@@ -32,8 +32,7 @@
#include <array>
-namespace nfd {
-namespace face {
+namespace nfd::face {
struct Unicast {};
struct Multicast {};
@@ -262,7 +261,6 @@
return 0;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_DATAGRAM_TRANSPORT_HPP
diff --git a/daemon/face/ethernet-channel.cpp b/daemon/face/ethernet-channel.cpp
index 2509140..4d0adc3 100644
--- a/daemon/face/ethernet-channel.cpp
+++ b/daemon/face/ethernet-channel.cpp
@@ -33,8 +33,7 @@
#include <boost/range/adaptor/map.hpp>
#include <pcap/pcap.h>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetChannel);
@@ -234,5 +233,4 @@
m_pcap.setPacketFilter(filter.data());
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-channel.hpp b/daemon/face/ethernet-channel.hpp
index 510b7aa..2096585 100644
--- a/daemon/face/ethernet-channel.hpp
+++ b/daemon/face/ethernet-channel.hpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing Ethernet-based channel to create faces
@@ -137,7 +136,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_CHANNEL_HPP
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index 4fea598..59f0c5c 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -30,8 +30,7 @@
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetFactory);
NFD_REGISTER_PROTOCOL_FACTORY(EthernetFactory);
@@ -377,5 +376,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-factory.hpp b/daemon/face/ethernet-factory.hpp
index 578a901..1d63397 100644
--- a/daemon/face/ethernet-factory.hpp
+++ b/daemon/face/ethernet-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "ethernet-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for Ethernet
*/
@@ -128,7 +127,6 @@
signal::ScopedConnection m_netifAddConn;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_FACTORY_HPP
diff --git a/daemon/face/ethernet-protocol.cpp b/daemon/face/ethernet-protocol.cpp
index 0a0ebe1..24478f8 100644
--- a/daemon/face/ethernet-protocol.cpp
+++ b/daemon/face/ethernet-protocol.cpp
@@ -27,8 +27,7 @@
#include <boost/endian/conversion.hpp>
-namespace nfd {
-namespace ethernet {
+namespace nfd::ethernet {
std::tuple<const ether_header*, std::string>
checkFrameHeader(span<const uint8_t> packet, const Address& localAddr, const Address& destAddr)
@@ -57,5 +56,4 @@
return {eh, ""};
}
-} // namespace ethernet
-} // namespace nfd
+} // namespace nfd::ethernet
diff --git a/daemon/face/ethernet-protocol.hpp b/daemon/face/ethernet-protocol.hpp
index c9b9bdc..50b4ac5 100644
--- a/daemon/face/ethernet-protocol.hpp
+++ b/daemon/face/ethernet-protocol.hpp
@@ -31,15 +31,13 @@
#include <ndn-cxx/net/ethernet.hpp>
#include <net/ethernet.h>
-namespace nfd {
-namespace ethernet {
+namespace nfd::ethernet {
using namespace ndn::ethernet;
std::tuple<const ether_header*, std::string>
checkFrameHeader(span<const uint8_t> packet, const Address& localAddr, const Address& destAddr);
-} // namespace ethernet
-} // namespace nfd
+} // namespace nfd::ethernet
#endif // NFD_DAEMON_FACE_ETHERNET_PROTOCOL_HPP
diff --git a/daemon/face/ethernet-transport.cpp b/daemon/face/ethernet-transport.cpp
index 568064b..53de0b7 100644
--- a/daemon/face/ethernet-transport.cpp
+++ b/daemon/face/ethernet-transport.cpp
@@ -33,8 +33,7 @@
#include <boost/endian/conversion.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(EthernetTransport);
@@ -230,5 +229,4 @@
doClose();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/ethernet-transport.hpp b/daemon/face/ethernet-transport.hpp
index 1379899..951d56a 100644
--- a/daemon/face/ethernet-transport.hpp
+++ b/daemon/face/ethernet-transport.hpp
@@ -32,8 +32,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief Base class for Ethernet-based Transports
@@ -113,7 +112,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/face-counters.cpp b/daemon/face/face-counters.cpp
index 275783f..ec8572e 100644
--- a/daemon/face/face-counters.cpp
+++ b/daemon/face/face-counters.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "face-counters.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
FaceCounters::FaceCounters(const LinkService::Counters& linkServiceCounters,
const Transport::Counters& transportCounters)
@@ -46,5 +45,4 @@
{
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/face-counters.hpp b/daemon/face/face-counters.hpp
index bfe08bd..7d7cdc3 100644
--- a/daemon/face/face-counters.hpp
+++ b/daemon/face/face-counters.hpp
@@ -29,8 +29,7 @@
#include "link-service.hpp"
#include "transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief gives access to counters provided by Face
*
@@ -94,7 +93,6 @@
const Transport::Counters& m_transportCounters;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_FACE_COUNTERS_HPP
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index f86ea25..7ab9879 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -29,8 +29,7 @@
#include "common/global.hpp"
#include "fw/face-table.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(FaceSystem);
@@ -163,5 +162,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/face.cpp b/daemon/face/face.cpp
index cc606d0..7b15dc5 100644
--- a/daemon/face/face.cpp
+++ b/daemon/face/face.cpp
@@ -25,8 +25,7 @@
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
Face::Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport)
: afterReceiveInterest(service->afterReceiveInterest)
@@ -51,5 +50,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/generic-link-service.cpp b/daemon/face/generic-link-service.cpp
index a21aec2..ed19eec 100644
--- a/daemon/face/generic-link-service.cpp
+++ b/daemon/face/generic-link-service.cpp
@@ -30,8 +30,7 @@
#include <cmath>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(GenericLinkService);
@@ -507,5 +506,4 @@
this->receiveNack(nack, endpointId);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 0f589a3..be216a7 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -31,8 +31,7 @@
#include "lp-reassembler.hpp"
#include "lp-reliability.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by GenericLinkService
* \note The type name 'GenericLinkServiceCounters' is implementation detail.
@@ -325,7 +324,6 @@
return *this;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_GENERIC_LINK_SERVICE_HPP
diff --git a/daemon/face/internal-face.cpp b/daemon/face/internal-face.cpp
index a7aa7fb..e899c5a 100644
--- a/daemon/face/internal-face.cpp
+++ b/daemon/face/internal-face.cpp
@@ -28,8 +28,7 @@
#include "internal-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
makeInternalFace(ndn::KeyChain& clientKeyChain)
@@ -49,5 +48,4 @@
return {face, clientFace};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/internal-face.hpp b/daemon/face/internal-face.hpp
index 94e1960..6b27cfa 100644
--- a/daemon/face/internal-face.hpp
+++ b/daemon/face/internal-face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,10 +27,10 @@
#define NFD_DAEMON_FACE_INTERNAL_FACE_HPP
#include "face.hpp"
+
#include <ndn-cxx/face.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief make a pair of forwarder-side face and client-side face
* that are connected with each other
@@ -45,7 +45,6 @@
std::tuple<shared_ptr<Face>, shared_ptr<ndn::Face>>
makeInternalFace(ndn::KeyChain& clientKeyChain);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_INTERNAL_FACE_HPP
diff --git a/daemon/face/internal-transport.cpp b/daemon/face/internal-transport.cpp
index 8f9da71..2eeab51 100644
--- a/daemon/face/internal-transport.cpp
+++ b/daemon/face/internal-transport.cpp
@@ -26,8 +26,7 @@
#include "internal-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT(InternalForwarderTransport, InternalForwarderTransport);
NFD_LOG_MEMBER_INIT(InternalClientTransport, InternalClientTransport);
@@ -123,5 +122,4 @@
m_forwarder->receivePacket(wire);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/internal-transport.hpp b/daemon/face/internal-transport.hpp
index d729ecd..886af5c 100644
--- a/daemon/face/internal-transport.hpp
+++ b/daemon/face/internal-transport.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/transport/transport.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Abstracts a transport that can be paired with another.
*/
@@ -125,7 +124,6 @@
signal::ScopedConnection m_fwTransportStateConn;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_INTERNAL_TRANSPORT_HPP
diff --git a/daemon/face/link-service.cpp b/daemon/face/link-service.cpp
index 6527dbd..d7233d0 100644
--- a/daemon/face/link-service.cpp
+++ b/daemon/face/link-service.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "link-service.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LinkService);
@@ -135,5 +134,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/link-service.hpp b/daemon/face/link-service.hpp
index e62c1a3..92645f4 100644
--- a/daemon/face/link-service.hpp
+++ b/daemon/face/link-service.hpp
@@ -30,8 +30,7 @@
#include "transport.hpp"
#include "common/counter.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by LinkService
* \note The type name 'LinkServiceCounters' is implementation detail.
@@ -258,7 +257,6 @@
return os << FaceLogHelper<LinkService>(flh.obj);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LINK_SERVICE_HPP
diff --git a/daemon/face/lp-fragmenter.cpp b/daemon/face/lp-fragmenter.cpp
index 6b1755a..0243a48 100644
--- a/daemon/face/lp-fragmenter.cpp
+++ b/daemon/face/lp-fragmenter.cpp
@@ -28,8 +28,7 @@
#include <ndn-cxx/encoding/tlv.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpFragmenter);
@@ -153,5 +152,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-fragmenter.hpp b/daemon/face/lp-fragmenter.hpp
index d98d752..8d24124 100644
--- a/daemon/face/lp-fragmenter.hpp
+++ b/daemon/face/lp-fragmenter.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/packet.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief fragments network-layer packets into NDNLPv2 link-layer packets
* \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
@@ -80,7 +79,6 @@
std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpFragmenter>& flh);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_FRAGMENTER_HPP
diff --git a/daemon/face/lp-reassembler.cpp b/daemon/face/lp-reassembler.cpp
index a4b255b..6c27d80 100644
--- a/daemon/face/lp-reassembler.cpp
+++ b/daemon/face/lp-reassembler.cpp
@@ -29,8 +29,7 @@
#include <numeric>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpReassembler);
@@ -161,5 +160,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-reassembler.hpp b/daemon/face/lp-reassembler.hpp
index 59db89b..8009c67 100644
--- a/daemon/face/lp-reassembler.hpp
+++ b/daemon/face/lp-reassembler.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/packet.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Reassembles fragmented network-layer packets
@@ -149,7 +148,6 @@
return m_partialPackets.size();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_REASSEMBLER_HPP
diff --git a/daemon/face/lp-reliability.cpp b/daemon/face/lp-reliability.cpp
index b287bc3..a3d2596 100644
--- a/daemon/face/lp-reliability.cpp
+++ b/daemon/face/lp-reliability.cpp
@@ -28,8 +28,7 @@
#include "transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(LpReliability);
@@ -426,5 +425,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index c83b0bc..17b2e44 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -34,8 +34,7 @@
#include <queue>
-namespace nfd {
-namespace face {
+namespace nfd::face {
class GenericLinkService;
@@ -221,7 +220,6 @@
std::ostream&
operator<<(std::ostream& os, const FaceLogHelper<LpReliability>& flh);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_LP_RELIABILITY_HPP
diff --git a/daemon/face/multicast-ethernet-transport.cpp b/daemon/face/multicast-ethernet-transport.cpp
index 5d34846..2068012 100644
--- a/daemon/face/multicast-ethernet-transport.cpp
+++ b/daemon/face/multicast-ethernet-transport.cpp
@@ -43,8 +43,7 @@
#endif
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(MulticastEthernetTransport);
@@ -146,5 +145,4 @@
NDN_THROW(Error("Failed to join multicast group"));
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/multicast-ethernet-transport.hpp b/daemon/face/multicast-ethernet-transport.hpp
index 8c2ce91..27c195c 100644
--- a/daemon/face/multicast-ethernet-transport.hpp
+++ b/daemon/face/multicast-ethernet-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "ethernet-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief A multicast Transport that uses raw Ethernet II frames
@@ -57,7 +56,6 @@
#endif
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_MULTICAST_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index ac66f36..bb373fd 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -37,8 +37,7 @@
#include <sys/socket.h> // for setsockopt()
#endif // __linux__
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>), MulticastUdpTransport);
@@ -207,5 +206,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/multicast-udp-transport.hpp b/daemon/face/multicast-udp-transport.hpp
index 3e17dc9..b881e81 100644
--- a/daemon/face/multicast-udp-transport.hpp
+++ b/daemon/face/multicast-udp-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Multicast>));
@@ -94,7 +93,6 @@
protocol::socket m_sendSocket;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_MULTICAST_UDP_TRANSPORT_HPP
diff --git a/daemon/face/netdev-bound.cpp b/daemon/face/netdev-bound.cpp
index b22bf62..3decef8 100644
--- a/daemon/face/netdev-bound.cpp
+++ b/daemon/face/netdev-bound.cpp
@@ -27,8 +27,7 @@
#include "face-system.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(NetdevBound);
@@ -141,5 +140,4 @@
return rule;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/netdev-bound.hpp b/daemon/face/netdev-bound.hpp
index be4a528..7328342 100644
--- a/daemon/face/netdev-bound.hpp
+++ b/daemon/face/netdev-bound.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "protocol-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
class FaceSystem;
@@ -82,7 +81,6 @@
std::map<Key, shared_ptr<Face>> m_faces;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NETDEV_BOUND_HPP
diff --git a/daemon/face/network-predicate.cpp b/daemon/face/network-predicate.cpp
index 07de63c..a13d886 100644
--- a/daemon/face/network-predicate.cpp
+++ b/daemon/face/network-predicate.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <fnmatch.h>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NetworkPredicateBase::NetworkPredicateBase()
{
@@ -227,5 +226,4 @@
[&address] (const auto& rule) { return doesAddressMatchRule(address, rule); });
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/network-predicate.hpp b/daemon/face/network-predicate.hpp
index 7f77486..2ea79d6 100644
--- a/daemon/face/network-predicate.hpp
+++ b/daemon/face/network-predicate.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <ndn-cxx/net/network-interface.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
class NetworkPredicateBase
{
@@ -130,7 +129,6 @@
isRuleValid(const std::string& key, const std::string& value) final;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NETWORK_PREDICATE_HPP
diff --git a/daemon/face/null-face.cpp b/daemon/face/null-face.cpp
index 77178c6..b96db7c 100644
--- a/daemon/face/null-face.cpp
+++ b/daemon/face/null-face.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include "null-link-service.hpp"
#include "null-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
shared_ptr<Face>
makeNullFace(const FaceUri& uri)
@@ -39,5 +38,4 @@
make_unique<NullTransport>(uri, uri, ndn::nfd::FACE_SCOPE_LOCAL));
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/null-face.hpp b/daemon/face/null-face.hpp
index a07b26c..b19bba6 100644
--- a/daemon/face/null-face.hpp
+++ b/daemon/face/null-face.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,15 +28,14 @@
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
-/** \return a Face that has no underlying transport and drops every packet
+/**
+ * \brief Returns a Face that has no underlying transport and drops every packet.
*/
shared_ptr<Face>
makeNullFace(const FaceUri& uri = FaceUri("null://"));
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_FACE_HPP
diff --git a/daemon/face/null-link-service.hpp b/daemon/face/null-link-service.hpp
index 2ae26ab..7ef2933 100644
--- a/daemon/face/null-link-service.hpp
+++ b/daemon/face/null-link-service.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "link-service.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief A LinkService that drops every packet.
*/
@@ -57,7 +56,6 @@
}
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_LINK_SERVICE_HPP
diff --git a/daemon/face/null-transport.cpp b/daemon/face/null-transport.cpp
index 912bf25..997238f 100644
--- a/daemon/face/null-transport.cpp
+++ b/daemon/face/null-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "null-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(NullTransport);
@@ -43,5 +42,4 @@
NFD_LOG_FACE_DEBUG("Creating transport");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/null-transport.hpp b/daemon/face/null-transport.hpp
index 1c81676..eea1559 100644
--- a/daemon/face/null-transport.hpp
+++ b/daemon/face/null-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief A Transport that drops every packet.
*/
@@ -56,7 +55,6 @@
}
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_NULL_TRANSPORT_HPP
diff --git a/daemon/face/pcap-helper.cpp b/daemon/face/pcap-helper.cpp
index d481ac5..054eda2 100644
--- a/daemon/face/pcap-helper.cpp
+++ b/daemon/face/pcap-helper.cpp
@@ -35,8 +35,7 @@
#define PCAP_NETMASK_UNKNOWN 0xffffffff
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
PcapHelper::PcapHelper(const std::string& interfaceName)
: m_pcap(nullptr)
@@ -143,5 +142,4 @@
return {{packet, header->caplen}, ""};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/pcap-helper.hpp b/daemon/face/pcap-helper.hpp
index 30a8deb..41bf066 100644
--- a/daemon/face/pcap-helper.hpp
+++ b/daemon/face/pcap-helper.hpp
@@ -36,8 +36,7 @@
struct pcap;
typedef pcap pcap_t;
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief Helper class for dealing with libpcap handles.
@@ -139,7 +138,6 @@
pcap_t* m_pcap;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_PCAP_HELPER_HPP
diff --git a/daemon/face/protocol-factory.cpp b/daemon/face/protocol-factory.cpp
index 5acb18f..1d70fda 100644
--- a/daemon/face/protocol-factory.cpp
+++ b/daemon/face/protocol-factory.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
ProtocolFactory::Registry&
ProtocolFactory::getRegistry()
@@ -129,5 +128,4 @@
return {};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/protocol-factory.hpp b/daemon/face/protocol-factory.hpp
index fcc0418..4d02d15 100644
--- a/daemon/face/protocol-factory.hpp
+++ b/daemon/face/protocol-factory.hpp
@@ -33,8 +33,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Parameters to ProtocolFactory constructor
*
@@ -248,8 +247,7 @@
shared_ptr<ndn::net::NetworkMonitor> netmon;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
/** \brief Registers a protocol factory
*
diff --git a/daemon/face/socket-utils.cpp b/daemon/face/socket-utils.cpp
index 5b38e40..8e3c5f1 100644
--- a/daemon/face/socket-utils.cpp
+++ b/daemon/face/socket-utils.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <sys/socket.h>
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
ssize_t
getTxQueueLength(int fd)
@@ -53,5 +52,4 @@
return queueLength;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/socket-utils.hpp b/daemon/face/socket-utils.hpp
index 3929d8a..9efb389 100644
--- a/daemon/face/socket-utils.hpp
+++ b/daemon/face/socket-utils.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief obtain send queue length from a specified system socket
* \param fd file descriptor of the socket
@@ -42,7 +41,6 @@
ssize_t
getTxQueueLength(int fd);
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_SOCKET_UTILS_HPP
diff --git a/daemon/face/stream-transport.hpp b/daemon/face/stream-transport.hpp
index c4ae849..ec33b26 100644
--- a/daemon/face/stream-transport.hpp
+++ b/daemon/face/stream-transport.hpp
@@ -32,8 +32,7 @@
#include <queue>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Implements Transport for stream-based protocols.
*
@@ -333,7 +332,6 @@
return m_sendQueueBytes;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_STREAM_TRANSPORT_HPP
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index 2dd454d..be029d0 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -29,8 +29,7 @@
#include "tcp-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(TcpChannel);
@@ -228,5 +227,4 @@
onConnectFailed(504, "Connection timed out");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-channel.hpp b/daemon/face/tcp-channel.hpp
index 19c714c..7193851 100644
--- a/daemon/face/tcp-channel.hpp
+++ b/daemon/face/tcp-channel.hpp
@@ -28,13 +28,11 @@
#include "channel.hpp"
-namespace nfd {
-
-namespace tcp {
+namespace nfd::tcp {
using Endpoint = boost::asio::ip::tcp::endpoint;
-} // namespace tcp
+} // namespace nfd::tcp
-namespace face {
+namespace nfd::face {
using DetermineFaceScopeFromAddress = std::function<ndn::nfd::FaceScope(const boost::asio::ip::address& local,
const boost::asio::ip::address& remote)>;
@@ -133,7 +131,6 @@
DetermineFaceScopeFromAddress m_determineFaceScope;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_CHANNEL_HPP
diff --git a/daemon/face/tcp-factory.cpp b/daemon/face/tcp-factory.cpp
index 89e34d5..8ff04cc 100644
--- a/daemon/face/tcp-factory.cpp
+++ b/daemon/face/tcp-factory.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "tcp-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
@@ -223,5 +222,4 @@
return ndn::nfd::FACE_SCOPE_NON_LOCAL;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 212acbb..87ffae8 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "tcp-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for TCP over IPv4 and IPv6
*/
@@ -83,7 +82,6 @@
IpAddressPredicate m_local;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_FACTORY_HPP
diff --git a/daemon/face/tcp-transport.cpp b/daemon/face/tcp-transport.cpp
index 466e2c6..0332c2f 100644
--- a/daemon/face/tcp-transport.cpp
+++ b/daemon/face/tcp-transport.cpp
@@ -31,8 +31,7 @@
#include <sys/ioctl.h>
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>, TcpTransport);
@@ -192,5 +191,4 @@
StreamTransport::doClose();
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/tcp-transport.hpp b/daemon/face/tcp-transport.hpp
index 950d850..595e574 100644
--- a/daemon/face/tcp-transport.hpp
+++ b/daemon/face/tcp-transport.hpp
@@ -28,8 +28,7 @@
#include "stream-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::ip::tcp>);
@@ -99,7 +98,6 @@
time::milliseconds m_nextReconnectWait;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TCP_TRANSPORT_HPP
diff --git a/daemon/face/transport.cpp b/daemon/face/transport.cpp
index 467843e..44babbb 100644
--- a/daemon/face/transport.cpp
+++ b/daemon/face/transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "transport.hpp"
#include "face.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(Transport);
@@ -235,5 +234,4 @@
return os;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/transport.hpp b/daemon/face/transport.hpp
index 2725596..ed91cbc 100644
--- a/daemon/face/transport.hpp
+++ b/daemon/face/transport.hpp
@@ -29,8 +29,7 @@
#include "face-common.hpp"
#include "common/counter.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Indicates the state of a transport.
*/
@@ -481,7 +480,6 @@
return os << FaceLogHelper<Transport>(flh.obj);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_TRANSPORT_HPP
diff --git a/daemon/face/udp-channel.cpp b/daemon/face/udp-channel.cpp
index 8804f06..4e91045 100644
--- a/daemon/face/udp-channel.cpp
+++ b/daemon/face/udp-channel.cpp
@@ -29,8 +29,7 @@
#include "unicast-udp-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UdpChannel);
@@ -197,5 +196,4 @@
return {true, face};
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/udp-channel.hpp b/daemon/face/udp-channel.hpp
index 25e735a..f4f53da 100644
--- a/daemon/face/udp-channel.hpp
+++ b/daemon/face/udp-channel.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <array>
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing UDP-based channel to create faces
@@ -117,7 +116,6 @@
bool m_wantCongestionMarking;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UDP_CHANNEL_HPP
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 9f43ad1..4feec76 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -31,8 +31,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
namespace net = ndn::net;
@@ -477,5 +476,4 @@
}
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/udp-factory.hpp b/daemon/face/udp-factory.hpp
index 28dbfaa..475621d 100644
--- a/daemon/face/udp-factory.hpp
+++ b/daemon/face/udp-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "udp-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for UDP over IPv4 and IPv6
*/
@@ -145,7 +144,6 @@
std::map<int, NetifConns> m_netifConns; // ifindex => signal connections
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UDP_FACTORY_HPP
diff --git a/daemon/face/udp-protocol.cpp b/daemon/face/udp-protocol.cpp
index 0d842bc..bfddd43 100644
--- a/daemon/face/udp-protocol.cpp
+++ b/daemon/face/udp-protocol.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "udp-protocol.hpp"
-namespace nfd {
-namespace udp {
+namespace nfd::udp {
ssize_t
computeMtu(const Endpoint& localEndpoint)
@@ -43,5 +42,4 @@
return mtu;
}
-} // namespace udp
-} // namespace nfd
+} // namespace nfd::udp
diff --git a/daemon/face/udp-protocol.hpp b/daemon/face/udp-protocol.hpp
index 85a6a5f..ebd3dad 100644
--- a/daemon/face/udp-protocol.hpp
+++ b/daemon/face/udp-protocol.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace udp {
+namespace nfd::udp {
typedef boost::asio::ip::udp::endpoint Endpoint;
@@ -54,7 +53,6 @@
return {boost::asio::ip::address_v6::from_string("FF02::1234"), 56363};
}
-} // namespace udp
-} // namespace nfd
+} // namespace nfd::udp
#endif // NFD_DAEMON_FACE_UDP_PROTOCOL_HPP
diff --git a/daemon/face/unicast-ethernet-transport.cpp b/daemon/face/unicast-ethernet-transport.cpp
index 853ca55..3da0681 100644
--- a/daemon/face/unicast-ethernet-transport.cpp
+++ b/daemon/face/unicast-ethernet-transport.cpp
@@ -28,8 +28,7 @@
#include <cstdio> // for snprintf()
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnicastEthernetTransport);
@@ -100,5 +99,4 @@
setExpirationTime(time::steady_clock::now() + m_idleTimeout);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unicast-ethernet-transport.hpp b/daemon/face/unicast-ethernet-transport.hpp
index 49c9d48..8078d44 100644
--- a/daemon/face/unicast-ethernet-transport.hpp
+++ b/daemon/face/unicast-ethernet-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "ethernet-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/**
* @brief A unicast Transport that uses raw Ethernet II frames
@@ -61,7 +60,6 @@
scheduler::ScopedEventId m_closeIfIdleEvent;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNICAST_ETHERNET_TRANSPORT_HPP
diff --git a/daemon/face/unicast-udp-transport.cpp b/daemon/face/unicast-udp-transport.cpp
index 140f691..e0a0526 100644
--- a/daemon/face/unicast-udp-transport.cpp
+++ b/daemon/face/unicast-udp-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,8 +34,7 @@
#include <sys/socket.h> // for setsockopt()
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>), UnicastUdpTransport);
@@ -115,5 +114,4 @@
setExpirationTime(time::steady_clock::now() + m_idleTimeout);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unicast-udp-transport.hpp b/daemon/face/unicast-udp-transport.hpp
index 991d561..7c96fef 100644
--- a/daemon/face/unicast-udp-transport.hpp
+++ b/daemon/face/unicast-udp-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "datagram-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED((DatagramTransport<boost::asio::ip::udp, Unicast>));
@@ -59,7 +58,6 @@
scheduler::ScopedEventId m_closeIfIdleEvent;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNICAST_UDP_TRANSPORT_HPP
diff --git a/daemon/face/unix-stream-channel.cpp b/daemon/face/unix-stream-channel.cpp
index 7fb828b..2526d45 100644
--- a/daemon/face/unix-stream-channel.cpp
+++ b/daemon/face/unix-stream-channel.cpp
@@ -32,8 +32,7 @@
#include <boost/filesystem.hpp>
#include <sys/stat.h> // for chmod()
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnixStreamChannel);
@@ -148,5 +147,4 @@
accept(onFaceCreated, onAcceptFailed);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-channel.hpp b/daemon/face/unix-stream-channel.hpp
index c65f784..0c2eb2e 100644
--- a/daemon/face/unix-stream-channel.hpp
+++ b/daemon/face/unix-stream-channel.hpp
@@ -28,13 +28,11 @@
#include "channel.hpp"
-namespace nfd {
-
-namespace unix_stream {
+namespace nfd::unix_stream {
using Endpoint = boost::asio::local::stream_protocol::endpoint;
-} // namespace unix_stream
+} // namespace nfd::unix_stream
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing a local channel to create faces
@@ -114,7 +112,6 @@
bool m_wantCongestionMarking;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_CHANNEL_HPP
diff --git a/daemon/face/unix-stream-factory.cpp b/daemon/face/unix-stream-factory.cpp
index f024dc6..a275fde 100644
--- a/daemon/face/unix-stream-factory.cpp
+++ b/daemon/face/unix-stream-factory.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <boost/filesystem.hpp>
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(UnixStreamFactory);
NFD_REGISTER_PROTOCOL_FACTORY(UnixStreamFactory);
@@ -109,5 +108,4 @@
return getChannelsFromMap(m_channels);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-factory.hpp b/daemon/face/unix-stream-factory.hpp
index 45be220..96ea3b1 100644
--- a/daemon/face/unix-stream-factory.hpp
+++ b/daemon/face/unix-stream-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "unix-stream-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for stream-oriented Unix sockets
*/
@@ -70,7 +69,6 @@
std::map<unix_stream::Endpoint, shared_ptr<UnixStreamChannel>> m_channels;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_FACTORY_HPP
diff --git a/daemon/face/unix-stream-transport.cpp b/daemon/face/unix-stream-transport.cpp
index a051ca9..76652f3 100644
--- a/daemon/face/unix-stream-transport.cpp
+++ b/daemon/face/unix-stream-transport.cpp
@@ -25,8 +25,7 @@
#include "unix-stream-transport.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_INIT_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>, UnixStreamTransport);
@@ -48,5 +47,4 @@
NFD_LOG_FACE_DEBUG("Creating transport");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/unix-stream-transport.hpp b/daemon/face/unix-stream-transport.hpp
index 1993143..8ad8a46 100644
--- a/daemon/face/unix-stream-transport.hpp
+++ b/daemon/face/unix-stream-transport.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#error "Cannot include this file when UNIX sockets are not available"
#endif
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_MEMBER_DECL_SPECIALIZED(StreamTransport<boost::asio::local::stream_protocol>);
@@ -47,7 +46,6 @@
UnixStreamTransport(protocol::socket&& socket);
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_UNIX_STREAM_TRANSPORT_HPP
diff --git a/daemon/face/websocket-channel.cpp b/daemon/face/websocket-channel.cpp
index 2ee41cd..acc029e 100644
--- a/daemon/face/websocket-channel.cpp
+++ b/daemon/face/websocket-channel.cpp
@@ -29,8 +29,7 @@
#include "websocket-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(WebSocketChannel);
@@ -162,5 +161,4 @@
NFD_LOG_CHAN_DEBUG("Started listening");
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index 52bf20f..d40bc70 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -29,13 +29,11 @@
#include "channel.hpp"
#include "websocketpp.hpp"
-namespace nfd {
-
-namespace websocket {
+namespace nfd::websocket {
using Endpoint = boost::asio::ip::tcp::endpoint;
-} // namespace websocket
+} // namespace nfd::websocket
-namespace face {
+namespace nfd::face {
/**
* \brief Class implementing WebSocket-based channel to create faces
@@ -111,7 +109,6 @@
time::milliseconds m_pingInterval;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_CHANNEL_HPP
diff --git a/daemon/face/websocket-factory.cpp b/daemon/face/websocket-factory.cpp
index 49e5740..069f137 100644
--- a/daemon/face/websocket-factory.cpp
+++ b/daemon/face/websocket-factory.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "websocket-factory.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
namespace ip = boost::asio::ip;
@@ -132,5 +131,4 @@
return getChannelsFromMap(m_channels);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-factory.hpp b/daemon/face/websocket-factory.hpp
index 721a1eb..1da0f98 100644
--- a/daemon/face/websocket-factory.hpp
+++ b/daemon/face/websocket-factory.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "protocol-factory.hpp"
#include "websocket-channel.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief Protocol factory for WebSocket
*/
@@ -71,7 +70,6 @@
std::map<websocket::Endpoint, shared_ptr<WebSocketChannel>> m_channels;
};
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_FACTORY_HPP
diff --git a/daemon/face/websocket-transport.cpp b/daemon/face/websocket-transport.cpp
index 2d118ec..df7b36b 100644
--- a/daemon/face/websocket-transport.cpp
+++ b/daemon/face/websocket-transport.cpp
@@ -26,8 +26,7 @@
#include "websocket-transport.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
NFD_LOG_INIT(WebSocketTransport);
@@ -174,5 +173,4 @@
this->setState(TransportState::CLOSED);
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
diff --git a/daemon/face/websocket-transport.hpp b/daemon/face/websocket-transport.hpp
index b71206a..4148872 100644
--- a/daemon/face/websocket-transport.hpp
+++ b/daemon/face/websocket-transport.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "transport.hpp"
#include "websocketpp.hpp"
-namespace nfd {
-namespace face {
+namespace nfd::face {
/** \brief counters provided by WebSocketTransport
* \note The type name 'WebSocketTransportCounters' is implementation detail.
@@ -107,7 +106,6 @@
return *this;
}
-} // namespace face
-} // namespace nfd
+} // namespace nfd::face
#endif // NFD_DAEMON_FACE_WEBSOCKET_TRANSPORT_HPP
diff --git a/daemon/face/websocketpp.hpp b/daemon/face/websocketpp.hpp
index 4815ed1..539d320 100644
--- a/daemon/face/websocketpp.hpp
+++ b/daemon/face/websocketpp.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -41,13 +41,11 @@
#include "websocketpp/config/asio_no_tls.hpp"
#include "websocketpp/server.hpp"
-namespace nfd {
-namespace websocket {
+namespace nfd::websocket {
-typedef websocketpp::client<websocketpp::config::asio_client> Client;
-typedef websocketpp::server<websocketpp::config::asio> Server;
+using Client = websocketpp::client<websocketpp::config::asio_client>;
+using Server = websocketpp::server<websocketpp::config::asio>;
-} // namespace websocket
-} // namespace nfd
+} // namespace nfd::websocket
#endif // NFD_DAEMON_FACE_WEBSOCKETPP_HPP
diff --git a/daemon/fw/access-strategy.cpp b/daemon/fw/access-strategy.cpp
index e80c581..c2b6504 100644
--- a/daemon/fw/access-strategy.cpp
+++ b/daemon/fw/access-strategy.cpp
@@ -28,8 +28,7 @@
#include "common/global.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(AccessStrategy);
NFD_REGISTER_STRATEGY(AccessStrategy);
@@ -278,5 +277,4 @@
return me->insertStrategyInfo<MtInfo>(m_rttEstimatorOpts).first;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/access-strategy.hpp b/daemon/fw/access-strategy.hpp
index 1aaa5ed..c33ad5c 100644
--- a/daemon/fw/access-strategy.hpp
+++ b/daemon/fw/access-strategy.hpp
@@ -33,8 +33,7 @@
#include <unordered_map>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Access Router strategy
*
@@ -173,7 +172,6 @@
signal::ScopedConnection m_removeFaceConn;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_ACCESS_STRATEGY_HPP
diff --git a/daemon/fw/algorithm.cpp b/daemon/fw/algorithm.cpp
index a4d864b..a16ccc3 100644
--- a/daemon/fw/algorithm.cpp
+++ b/daemon/fw/algorithm.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "algorithm.hpp"
#include "scope-prefix.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
bool
wouldViolateScope(const Face& inFace, const Interest& interest, const Face& outFace)
@@ -151,5 +150,4 @@
return true;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/algorithm.hpp b/daemon/fw/algorithm.hpp
index b37d540..2ff4c2c 100644
--- a/daemon/fw/algorithm.hpp
+++ b/daemon/fw/algorithm.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
* This file contains common algorithms used by forwarding strategies.
*/
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief determine whether forwarding the Interest in \p pitEntry to \p outFace would violate scope
* \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
@@ -93,7 +92,6 @@
bool wantUnused = false,
time::steady_clock::TimePoint now = time::steady_clock::TimePoint::min());
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_ALGORITHM_HPP
diff --git a/daemon/fw/asf-measurements.cpp b/daemon/fw/asf-measurements.cpp
index c49f5d5..df1f4ff 100644
--- a/daemon/fw/asf-measurements.cpp
+++ b/daemon/fw/asf-measurements.cpp
@@ -26,9 +26,7 @@
#include "asf-measurements.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
time::nanoseconds
FaceInfo::scheduleTimeout(const Name& interestName, scheduler::EventCallback cb)
@@ -142,6 +140,4 @@
m_measurements.extendLifetime(me, MEASUREMENTS_LIFETIME);
}
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
diff --git a/daemon/fw/asf-measurements.hpp b/daemon/fw/asf-measurements.hpp
index 1d2b90f..bfed7ca 100644
--- a/daemon/fw/asf-measurements.hpp
+++ b/daemon/fw/asf-measurements.hpp
@@ -33,9 +33,7 @@
#include <unordered_map>
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
/** \brief Strategy information for each face in a namespace
*/
@@ -217,8 +215,6 @@
shared_ptr<const ndn::util::RttEstimator::Options> m_rttEstimatorOpts;
};
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
#endif // NFD_DAEMON_FW_ASF_MEASUREMENTS_HPP
diff --git a/daemon/fw/asf-probing-module.cpp b/daemon/fw/asf-probing-module.cpp
index 0df1712..25e0ac3 100644
--- a/daemon/fw/asf-probing-module.cpp
+++ b/daemon/fw/asf-probing-module.cpp
@@ -29,9 +29,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
static_assert(ProbingModule::DEFAULT_PROBING_INTERVAL < AsfMeasurements::MEASUREMENTS_LIFETIME);
@@ -178,6 +176,4 @@
}
}
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
diff --git a/daemon/fw/asf-probing-module.hpp b/daemon/fw/asf-probing-module.hpp
index 654b569..0d6b212 100644
--- a/daemon/fw/asf-probing-module.hpp
+++ b/daemon/fw/asf-probing-module.hpp
@@ -28,9 +28,7 @@
#include "asf-measurements.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
/** \brief ASF Probing Module
*/
@@ -97,8 +95,6 @@
AsfMeasurements& m_measurements;
};
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
#endif // NFD_DAEMON_FW_ASF_PROBING_MODULE_HPP
diff --git a/daemon/fw/asf-strategy.cpp b/daemon/fw/asf-strategy.cpp
index 79181a2..d4ea944 100644
--- a/daemon/fw/asf-strategy.cpp
+++ b/daemon/fw/asf-strategy.cpp
@@ -28,9 +28,7 @@
#include "common/global.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
-namespace asf {
+namespace nfd::fw::asf {
NFD_LOG_INIT(AsfStrategy);
NFD_REGISTER_STRATEGY(AsfStrategy);
@@ -326,6 +324,4 @@
this->rejectPendingInterest(pitEntry);
}
-} // namespace asf
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw::asf
diff --git a/daemon/fw/asf-strategy.hpp b/daemon/fw/asf-strategy.hpp
index 95d1d71..0e6f3a2 100644
--- a/daemon/fw/asf-strategy.hpp
+++ b/daemon/fw/asf-strategy.hpp
@@ -31,8 +31,7 @@
#include "asf-probing-module.hpp"
#include "retx-suppression-exponential.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
namespace asf {
/** \brief Adaptive SRTT-based Forwarding Strategy
@@ -97,7 +96,6 @@
using asf::AsfStrategy;
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_ASF_STRATEGY_HPP
diff --git a/daemon/fw/best-route-strategy.cpp b/daemon/fw/best-route-strategy.cpp
index 94f2e29..0de6265 100644
--- a/daemon/fw/best-route-strategy.cpp
+++ b/daemon/fw/best-route-strategy.cpp
@@ -27,8 +27,7 @@
#include "algorithm.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(BestRouteStrategy);
NFD_REGISTER_STRATEGY(BestRouteStrategy);
@@ -126,5 +125,4 @@
this->processNack(nack, ingress.face, pitEntry);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/best-route-strategy.hpp b/daemon/fw/best-route-strategy.hpp
index 5b4e27d..484ac51 100644
--- a/daemon/fw/best-route-strategy.hpp
+++ b/daemon/fw/best-route-strategy.hpp
@@ -30,8 +30,7 @@
#include "process-nack-traits.hpp"
#include "retx-suppression-exponential.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Best Route strategy
*
@@ -75,7 +74,6 @@
friend ProcessNackTraits<BestRouteStrategy>;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_BEST_ROUTE_STRATEGY_HPP
diff --git a/daemon/fw/multicast-strategy.cpp b/daemon/fw/multicast-strategy.cpp
index f49f60a..ab8e12a 100644
--- a/daemon/fw/multicast-strategy.cpp
+++ b/daemon/fw/multicast-strategy.cpp
@@ -27,8 +27,7 @@
#include "algorithm.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_REGISTER_STRATEGY(MulticastStrategy);
@@ -111,5 +110,4 @@
// if nothing found, the interest will not be forwarded
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/multicast-strategy.hpp b/daemon/fw/multicast-strategy.hpp
index 6ff301d..6abbb38 100644
--- a/daemon/fw/multicast-strategy.hpp
+++ b/daemon/fw/multicast-strategy.hpp
@@ -29,8 +29,7 @@
#include "strategy.hpp"
#include "retx-suppression-exponential.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief A forwarding strategy that forwards Interests to all FIB nexthops
*/
@@ -55,7 +54,6 @@
std::unique_ptr<RetxSuppressionExponential> m_retxSuppression;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_MULTICAST_STRATEGY_HPP
diff --git a/daemon/fw/process-nack-traits.cpp b/daemon/fw/process-nack-traits.cpp
index 80e5c40..4b4fbbc 100644
--- a/daemon/fw/process-nack-traits.cpp
+++ b/daemon/fw/process-nack-traits.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "process-nack-traits.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(ProcessNackTraits);
@@ -82,5 +81,4 @@
this->sendNacksForProcessNackTraits(pitEntry, outNack);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/process-nack-traits.hpp b/daemon/fw/process-nack-traits.hpp
index c07537b..6a98da4 100644
--- a/daemon/fw/process-nack-traits.hpp
+++ b/daemon/fw/process-nack-traits.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "strategy.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Provides a common procedure for processing Nacks
*
@@ -95,7 +94,6 @@
S* m_strategy;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_PROCESS_NACK_TRAITS_HPP
diff --git a/daemon/fw/random-strategy.cpp b/daemon/fw/random-strategy.cpp
index 2ab24c9..b4950e7 100644
--- a/daemon/fw/random-strategy.cpp
+++ b/daemon/fw/random-strategy.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_REGISTER_STRATEGY(RandomStrategy);
NFD_LOG_INIT(RandomStrategy);
@@ -87,5 +86,4 @@
this->processNack(nack, ingress.face, pitEntry);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/random-strategy.hpp b/daemon/fw/random-strategy.hpp
index 27b2041..31b1e26 100644
--- a/daemon/fw/random-strategy.hpp
+++ b/daemon/fw/random-strategy.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "strategy.hpp"
#include "process-nack-traits.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief A forwarding strategy that randomly chooses a nexthop
*
@@ -59,7 +58,6 @@
friend ProcessNackTraits<RandomStrategy>;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RANDOM_STRATEGY_HPP
diff --git a/daemon/fw/retx-suppression-exponential.cpp b/daemon/fw/retx-suppression-exponential.cpp
index 6158120..6d8cdcb 100644
--- a/daemon/fw/retx-suppression-exponential.cpp
+++ b/daemon/fw/retx-suppression-exponential.cpp
@@ -26,8 +26,7 @@
#include "retx-suppression-exponential.hpp"
#include "algorithm.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
namespace {
@@ -143,5 +142,4 @@
return make_unique<RetxSuppressionExponential>(Duration(init), Duration(max), mult);
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/retx-suppression-exponential.hpp b/daemon/fw/retx-suppression-exponential.hpp
index 41d5bdb..fd8e2c6 100644
--- a/daemon/fw/retx-suppression-exponential.hpp
+++ b/daemon/fw/retx-suppression-exponential.hpp
@@ -29,8 +29,7 @@
#include "retx-suppression.hpp"
#include "strategy.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/**
* \brief A retransmission suppression decision algorithm that suppresses
@@ -92,7 +91,6 @@
const float m_multiplier;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RETX_SUPPRESSION_EXPONENTIAL_HPP
diff --git a/daemon/fw/retx-suppression-fixed.cpp b/daemon/fw/retx-suppression-fixed.cpp
index 790ce45..c2f190b 100644
--- a/daemon/fw/retx-suppression-fixed.cpp
+++ b/daemon/fw/retx-suppression-fixed.cpp
@@ -26,8 +26,7 @@
#include "retx-suppression-fixed.hpp"
#include "algorithm.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
RetxSuppressionFixed::RetxSuppressionFixed(const time::milliseconds& minRetxInterval)
: m_minRetxInterval(minRetxInterval)
@@ -50,5 +49,4 @@
return shouldSuppress ? RetxSuppressionResult::SUPPRESS : RetxSuppressionResult::FORWARD;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/retx-suppression-fixed.hpp b/daemon/fw/retx-suppression-fixed.hpp
index e8af73b..fdd1114 100644
--- a/daemon/fw/retx-suppression-fixed.hpp
+++ b/daemon/fw/retx-suppression-fixed.hpp
@@ -29,8 +29,7 @@
#include "retx-suppression.hpp"
#include "table/pit-entry.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief a retransmission suppression decision algorithm that
* suppresses retransmissions within a fixed duration
@@ -54,7 +53,6 @@
const time::milliseconds m_minRetxInterval;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RETX_SUPPRESSION_FIXED_HPP
diff --git a/daemon/fw/retx-suppression.hpp b/daemon/fw/retx-suppression.hpp
index ad983e7..7cf6893 100644
--- a/daemon/fw/retx-suppression.hpp
+++ b/daemon/fw/retx-suppression.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2017, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
enum class RetxSuppressionResult {
/** \brief Interest is new (not a retransmission)
@@ -45,7 +44,6 @@
SUPPRESS
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_RETX_SUPPRESSION_HPP
diff --git a/daemon/fw/scope-prefix.cpp b/daemon/fw/scope-prefix.cpp
index 984d19c..7f6043b 100644
--- a/daemon/fw/scope-prefix.cpp
+++ b/daemon/fw/scope-prefix.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,11 +25,9 @@
#include "scope-prefix.hpp"
-namespace nfd {
-namespace scope_prefix {
+namespace nfd::scope_prefix {
const Name LOCALHOST("ndn:/localhost");
const Name LOCALHOP("ndn:/localhop");
-} // namespace scope_prefix
-} // namespace nfd
+} // namespace nfd::scope_prefix
diff --git a/daemon/fw/scope-prefix.hpp b/daemon/fw/scope-prefix.hpp
index 265959d..fd8796c 100644
--- a/daemon/fw/scope-prefix.hpp
+++ b/daemon/fw/scope-prefix.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
/** \brief contain name prefixes that affect namespace-based scope control
* \sa https://redmine.named-data.net/projects/nfd/wiki/ScopeControl
*/
-namespace nfd {
-namespace scope_prefix {
+namespace nfd::scope_prefix {
/** \brief ndn:/localhost
*
@@ -58,7 +57,6 @@
*/
extern const Name LOCALHOP;
-} // namespace scope_prefix
-} // namespace nfd
+} // namespace nfd::scope_prefix
#endif // NFD_DAEMON_FW_SCOPE_PREFIX_HPP
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index db58050..399b970 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -36,8 +36,7 @@
#include <boost/range/adaptor/reversed.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(SelfLearningStrategy);
NFD_REGISTER_STRATEGY(SelfLearningStrategy);
@@ -258,5 +257,4 @@
});
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/self-learning-strategy.hpp b/daemon/fw/self-learning-strategy.hpp
index 47e59af..118fe3d 100644
--- a/daemon/fw/self-learning-strategy.hpp
+++ b/daemon/fw/self-learning-strategy.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/lp/prefix-announcement-header.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Self-learning forwarding strategy
*
@@ -138,7 +137,6 @@
renewRoute(const Name& name, FaceId inFaceId, time::milliseconds maxLifetime);
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_SELF_LEARNING_STRATEGY_HPP
diff --git a/daemon/fw/strategy-info.hpp b/daemon/fw/strategy-info.hpp
index 49b5b95..db6e9e6 100644
--- a/daemon/fw/strategy-info.hpp
+++ b/daemon/fw/strategy-info.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/** \brief Contains arbitrary information placed by the forwarding strategy on table entries
*/
@@ -51,7 +50,6 @@
StrategyInfo() = default;
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
#endif // NFD_DAEMON_FW_STRATEGY_INFO_HPP
diff --git a/daemon/fw/strategy.cpp b/daemon/fw/strategy.cpp
index 1f7babc..d47df3a 100644
--- a/daemon/fw/strategy.cpp
+++ b/daemon/fw/strategy.cpp
@@ -33,8 +33,7 @@
#include <boost/range/algorithm/copy.hpp>
#include <unordered_set>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
NFD_LOG_INIT(Strategy);
@@ -339,5 +338,4 @@
return *fibEntry; // only occurs if no delegation finds a FIB nexthop
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/strategy.hpp b/daemon/fw/strategy.hpp
index 570f219..4c9a2e5 100644
--- a/daemon/fw/strategy.hpp
+++ b/daemon/fw/strategy.hpp
@@ -29,8 +29,7 @@
#include "forwarder.hpp"
#include "table/measurements-accessor.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
class StrategyParameters;
@@ -480,8 +479,7 @@
}
};
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
/** \brief Registers a strategy
*
diff --git a/daemon/fw/unsolicited-data-policy.cpp b/daemon/fw/unsolicited-data-policy.cpp
index b29b827..8ad0f66 100644
--- a/daemon/fw/unsolicited-data-policy.cpp
+++ b/daemon/fw/unsolicited-data-policy.cpp
@@ -28,8 +28,7 @@
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
std::ostream&
operator<<(std::ostream& os, UnsolicitedDataDecision d)
@@ -109,5 +108,4 @@
return UnsolicitedDataDecision::CACHE;
}
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
diff --git a/daemon/fw/unsolicited-data-policy.hpp b/daemon/fw/unsolicited-data-policy.hpp
index 486903a..d49d40a 100644
--- a/daemon/fw/unsolicited-data-policy.hpp
+++ b/daemon/fw/unsolicited-data-policy.hpp
@@ -28,8 +28,7 @@
#include "face/face.hpp"
-namespace nfd {
-namespace fw {
+namespace nfd::fw {
/**
* \brief Decision made by UnsolicitedDataPolicy
@@ -144,8 +143,7 @@
*/
using DefaultUnsolicitedDataPolicy = DropAllUnsolicitedDataPolicy;
-} // namespace fw
-} // namespace nfd
+} // namespace nfd::fw
/**
* \brief Registers an unsolicited data policy
diff --git a/daemon/mgmt/general-config-section.cpp b/daemon/mgmt/general-config-section.cpp
index de9c611..daaa103 100644
--- a/daemon/mgmt/general-config-section.cpp
+++ b/daemon/mgmt/general-config-section.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "general-config-section.hpp"
#include "common/privilege-helper.hpp"
-namespace nfd {
-namespace general {
+namespace nfd::general {
static void
onConfig(const ConfigSection& section, bool isDryRun, const std::string&)
@@ -75,5 +74,4 @@
config.addSectionHandler("general", &onConfig);
}
-} // namespace general
-} // namespace nfd
+} // namespace nfd::general
diff --git a/daemon/mgmt/general-config-section.hpp b/daemon/mgmt/general-config-section.hpp
index cd9089d..6c822d9 100644
--- a/daemon/mgmt/general-config-section.hpp
+++ b/daemon/mgmt/general-config-section.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,13 +28,11 @@
#include "common/config-file.hpp"
-namespace nfd {
-namespace general {
+namespace nfd::general {
void
setConfigFile(ConfigFile& config);
-} // namespace general
-} // namespace nfd
+} // namespace nfd::general
#endif // NFD_DAEMON_MGMT_GENERAL_CONFIG_SECTION_HPP
diff --git a/daemon/mgmt/log-config-section.cpp b/daemon/mgmt/log-config-section.cpp
index 9d8168c..9408812 100644
--- a/daemon/mgmt/log-config-section.cpp
+++ b/daemon/mgmt/log-config-section.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/util/logger.hpp>
#include <ndn-cxx/util/logging.hpp>
-namespace nfd {
-namespace log {
+namespace nfd::log {
static ndn::util::LogLevel
parseLogLevel(const ConfigSection& item, const std::string& key)
@@ -92,5 +91,4 @@
config.addSectionHandler("log", &onConfig);
}
-} // namespace log
-} // namespace nfd
+} // namespace nfd::log
diff --git a/daemon/mgmt/log-config-section.hpp b/daemon/mgmt/log-config-section.hpp
index e7e4022..526b66d 100644
--- a/daemon/mgmt/log-config-section.hpp
+++ b/daemon/mgmt/log-config-section.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,13 +28,11 @@
#include "common/config-file.hpp"
-namespace nfd {
-namespace log {
+namespace nfd::log {
void
setConfigFile(ConfigFile& config);
-} // namespace log
-} // namespace nfd
+} // namespace nfd::log
#endif // NFD_DAEMON_MGMT_LOG_CONFIG_SECTION_HPP
diff --git a/daemon/rib/fib-update.cpp b/daemon/rib/fib-update.cpp
index 25e2a62..ca53565 100644
--- a/daemon/rib/fib-update.cpp
+++ b/daemon/rib/fib-update.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "fib-update.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
FibUpdate
FibUpdate::createAddUpdate(const Name& name, const uint64_t faceId, const uint64_t cost)
@@ -53,5 +52,4 @@
return update;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/fib-update.hpp b/daemon/rib/fib-update.hpp
index 5339a37..6eead74 100644
--- a/daemon/rib/fib-update.hpp
+++ b/daemon/rib/fib-update.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \class FibUpdate
* \brief represents a FIB update
@@ -90,7 +89,6 @@
return os;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_FIB_UPDATE_HPP
diff --git a/daemon/rib/fib-updater.cpp b/daemon/rib/fib-updater.cpp
index 5208e61..6f82b17 100644
--- a/daemon/rib/fib-updater.cpp
+++ b/daemon/rib/fib-updater.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(FibUpdater);
@@ -708,5 +707,4 @@
m_inheritedRoutes.push_back(update);
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/fib-updater.hpp b/daemon/rib/fib-updater.hpp
index d43f50a..e231341 100644
--- a/daemon/rib/fib-updater.hpp
+++ b/daemon/rib/fib-updater.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <ndn-cxx/mgmt/nfd/controller.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief computes FibUpdates based on updates to the RIB and sends them to NFD
*/
@@ -267,7 +266,6 @@
RibUpdateList m_inheritedRoutes;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_FIB_UPDATER_HPP
diff --git a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
index 7aff618..dcce60a 100644
--- a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
+++ b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.cpp
@@ -25,8 +25,7 @@
#include "client-to-nlsr-readvertise-policy.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
std::optional<ReadvertiseAction>
ClientToNlsrReadvertisePolicy::handleNewRoute(const RibRouteRef& ribRoute) const
@@ -45,5 +44,4 @@
return 1_h;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
index c0d5837..be76597 100644
--- a/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
+++ b/daemon/rib/readvertise/client-to-nlsr-readvertise-policy.hpp
@@ -28,8 +28,7 @@
#include "readvertise-policy.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a policy to readvertise routes registered by end hosts into NLSR
*/
@@ -48,7 +47,6 @@
getRefreshInterval() const override;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_CLIENT_TO_NLSR_READVERTISE_POLICY_HPP
diff --git a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
index 5aa6e3b..2d8d3a5 100644
--- a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
+++ b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.cpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/security/pib/identity.hpp>
#include <ndn-cxx/security/signing-helpers.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
const name::Component IGNORE_COMPONENT("nrd");
const time::seconds DEFAULT_REFRESH_INTERVAL = 25_s;
@@ -85,5 +84,4 @@
return m_refreshInterval;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp
index ac2491d..63b4fc8 100644
--- a/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp
+++ b/daemon/rib/readvertise/host-to-gateway-readvertise-policy.hpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/security/key-chain.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a policy to readvertise routes registered by local applications into remote gateway
*/
@@ -54,7 +53,6 @@
time::seconds m_refreshInterval;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_HOST_TO_GATEWAY_READVERTISE_POLICY_HPP
diff --git a/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp b/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
index 0592040..413320e 100644
--- a/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
+++ b/daemon/rib/readvertise/nfd-rib-readvertise-destination.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include <ndn-cxx/mgmt/nfd/control-command.hpp>
#include <ndn-cxx/mgmt/nfd/control-response.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(NfdRibReadvertiseDestination);
@@ -85,5 +84,4 @@
getCommandOptions().setSigningInfo(rr.signer));
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp b/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
index 0f61669..ab2f710 100644
--- a/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
+++ b/daemon/rib/readvertise/nfd-rib-readvertise-destination.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -33,8 +33,7 @@
#include <ndn-cxx/mgmt/nfd/controller.hpp>
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a readvertise destination using NFD RIB management protocol
*/
@@ -84,7 +83,6 @@
ndn::nfd::ControlParameters m_controlParameters;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_NFD_RIB_READVERTISE_DESTINATION_HPP
diff --git a/daemon/rib/readvertise/readvertise-destination.cpp b/daemon/rib/readvertise/readvertise-destination.cpp
index 972c1dc..53f82ab 100644
--- a/daemon/rib/readvertise/readvertise-destination.cpp
+++ b/daemon/rib/readvertise/readvertise-destination.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "readvertise-destination.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(ReadvertiseDestination);
@@ -46,5 +45,4 @@
}
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/readvertise-destination.hpp b/daemon/rib/readvertise/readvertise-destination.hpp
index 1c4fb76..045483a 100644
--- a/daemon/rib/readvertise/readvertise-destination.hpp
+++ b/daemon/rib/readvertise/readvertise-destination.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "readvertised-route.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a destination to readvertise into
*/
@@ -68,7 +67,6 @@
bool m_isAvailable = false;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISE_DESTINATION_HPP
diff --git a/daemon/rib/readvertise/readvertise-policy.hpp b/daemon/rib/readvertise/readvertise-policy.hpp
index da22139..3e4456e 100644
--- a/daemon/rib/readvertise/readvertise-policy.hpp
+++ b/daemon/rib/readvertise/readvertise-policy.hpp
@@ -30,8 +30,7 @@
#include <ndn-cxx/security/signing-info.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief a decision made by readvertise policy
*/
@@ -60,7 +59,6 @@
getRefreshInterval() const = 0;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISE_POLICY_HPP
diff --git a/daemon/rib/readvertise/readvertise.cpp b/daemon/rib/readvertise/readvertise.cpp
index ded568d..f7eb4cd 100644
--- a/daemon/rib/readvertise/readvertise.cpp
+++ b/daemon/rib/readvertise/readvertise.cpp
@@ -29,8 +29,7 @@
#include <ndn-cxx/util/random.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(Readvertise);
@@ -193,5 +192,4 @@
});
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/readvertise/readvertise.hpp b/daemon/rib/readvertise/readvertise.hpp
index aeaa823..88b11aa 100644
--- a/daemon/rib/readvertise/readvertise.hpp
+++ b/daemon/rib/readvertise/readvertise.hpp
@@ -31,8 +31,7 @@
#include "readvertised-route.hpp"
#include "rib/rib.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief readvertise a subset of routes to a destination according to a policy
*
@@ -81,7 +80,6 @@
signal::ScopedConnection m_removeRouteConn;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISE_HPP
diff --git a/daemon/rib/readvertise/readvertised-route.hpp b/daemon/rib/readvertise/readvertised-route.hpp
index 3749336..e4be12c 100644
--- a/daemon/rib/readvertise/readvertised-route.hpp
+++ b/daemon/rib/readvertise/readvertised-route.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include <ndn-cxx/security/signing-info.hpp>
#include <ndn-cxx/util/scheduler.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief state of a readvertised route
*/
@@ -63,7 +62,6 @@
using ReadvertisedRouteContainer = std::set<ReadvertisedRoute>;
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_READVERTISE_READVERTISED_ROUTE_HPP
diff --git a/daemon/rib/rib-entry.cpp b/daemon/rib/rib-entry.cpp
index 1710aff..1df227e 100644
--- a/daemon/rib/rib-entry.cpp
+++ b/daemon/rib/rib-entry.cpp
@@ -28,8 +28,7 @@
#include <ndn-cxx/mgmt/nfd/control-command.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(RibEntry);
@@ -288,5 +287,4 @@
return os << "}";
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib-entry.hpp b/daemon/rib/rib-entry.hpp
index 79f1627..d98d72a 100644
--- a/daemon/rib/rib-entry.hpp
+++ b/daemon/rib/rib-entry.hpp
@@ -30,8 +30,7 @@
#include <list>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/**
* \brief Represents a RIB entry, which contains one or more Routes with the same prefix.
@@ -278,7 +277,6 @@
std::ostream&
operator<<(std::ostream& os, const RibEntry& entry);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_ENTRY_HPP
diff --git a/daemon/rib/rib-update-batch.cpp b/daemon/rib/rib-update-batch.cpp
index e639ae3..12284f7 100644
--- a/daemon/rib/rib-update-batch.cpp
+++ b/daemon/rib/rib-update-batch.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2015, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "rib-update-batch.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
RibUpdateBatch::RibUpdateBatch(uint64_t faceId)
: m_faceId(faceId)
@@ -59,5 +58,4 @@
return m_updates.size();
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib-update-batch.hpp b/daemon/rib/rib-update-batch.hpp
index f3facb3..a91cad3 100644
--- a/daemon/rib/rib-update-batch.hpp
+++ b/daemon/rib/rib-update-batch.hpp
@@ -30,8 +30,7 @@
#include <list>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
using RibUpdateList = std::list<RibUpdate>;
@@ -69,7 +68,6 @@
RibUpdateList m_updates;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_UPDATE_BATCH_HPP
diff --git a/daemon/rib/rib-update.cpp b/daemon/rib/rib-update.cpp
index be2636d..343d39e 100644
--- a/daemon/rib/rib-update.cpp
+++ b/daemon/rib/rib-update.cpp
@@ -25,8 +25,7 @@
#include "rib-update.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
std::ostream&
operator<<(std::ostream& os, RibUpdate::Action action)
@@ -55,5 +54,4 @@
<< "}";
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib-update.hpp b/daemon/rib/rib-update.hpp
index bcdb342..70bbe1e 100644
--- a/daemon/rib/rib-update.hpp
+++ b/daemon/rib/rib-update.hpp
@@ -29,8 +29,7 @@
#include "core/common.hpp"
#include "route.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/**
* \brief Represents a route that will be added to or removed from a namespace
@@ -118,7 +117,6 @@
std::ostream&
operator<<(std::ostream& os, const RibUpdate& update);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_UPDATE_HPP
diff --git a/daemon/rib/rib.cpp b/daemon/rib/rib.cpp
index fe4db0b..1d002a1 100644
--- a/daemon/rib/rib.cpp
+++ b/daemon/rib/rib.cpp
@@ -27,8 +27,7 @@
#include "fib-updater.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(Rib);
@@ -496,5 +495,4 @@
return os;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/rib.hpp b/daemon/rib/rib.hpp
index f6912c3..36d5e41 100644
--- a/daemon/rib/rib.hpp
+++ b/daemon/rib/rib.hpp
@@ -31,8 +31,7 @@
#include <ndn-cxx/mgmt/nfd/control-parameters.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
using ndn::nfd::ControlParameters;
@@ -254,7 +253,6 @@
std::ostream&
operator<<(std::ostream& os, const Rib& rib);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_RIB_HPP
diff --git a/daemon/rib/route.cpp b/daemon/rib/route.cpp
index 99d80e5..78ccdad 100644
--- a/daemon/rib/route.cpp
+++ b/daemon/rib/route.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "route.hpp"
#include <ndn-cxx/util/string-helper.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
const uint64_t PA_ROUTE_COST = 2048; ///< cost of route created by prefix announcement
@@ -92,5 +91,4 @@
return os;
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/route.hpp b/daemon/rib/route.hpp
index 9b0bead..eea42ee 100644
--- a/daemon/rib/route.hpp
+++ b/daemon/rib/route.hpp
@@ -35,8 +35,7 @@
#include <type_traits>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
/** \brief represents a route for a name prefix
*/
@@ -116,7 +115,6 @@
std::ostream&
operator<<(std::ostream& os, const Route& route);
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_ROUTE_HPP
diff --git a/daemon/rib/service.cpp b/daemon/rib/service.cpp
index d850ed2..1634ef9 100644
--- a/daemon/rib/service.cpp
+++ b/daemon/rib/service.cpp
@@ -38,8 +38,7 @@
#include <ndn-cxx/transport/tcp-transport.hpp>
#include <ndn-cxx/transport/unix-transport.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
NFD_LOG_INIT(RibService);
@@ -262,5 +261,4 @@
}
}
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
diff --git a/daemon/rib/service.hpp b/daemon/rib/service.hpp
index 8928011..02e1914 100644
--- a/daemon/rib/service.hpp
+++ b/daemon/rib/service.hpp
@@ -38,8 +38,7 @@
#include <ndn-cxx/transport/transport.hpp>
#include <ndn-cxx/util/scheduler.hpp>
-namespace nfd {
-namespace rib {
+namespace nfd::rib {
class Readvertise;
@@ -121,7 +120,6 @@
RibManager m_ribManager;
};
-} // namespace rib
-} // namespace nfd
+} // namespace nfd::rib
#endif // NFD_DAEMON_RIB_SERVICE_HPP
diff --git a/daemon/table/cs-entry.cpp b/daemon/table/cs-entry.cpp
index 470e850..e02caa1 100644
--- a/daemon/table/cs-entry.cpp
+++ b/daemon/table/cs-entry.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "cs-entry.hpp"
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
Entry::Entry(shared_ptr<const Data> data, bool isUnsolicited)
: m_data(std::move(data))
@@ -111,5 +110,4 @@
return compareDataWithData(lhs.getData(), rhs.getData()) < 0;
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/cs-entry.hpp b/daemon/table/cs-entry.hpp
index 5dd931d..a04f9f7 100644
--- a/daemon/table/cs-entry.hpp
+++ b/daemon/table/cs-entry.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "core/common.hpp"
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
/** \brief a ContentStore entry
*/
@@ -121,7 +120,6 @@
return *lhs < *rhs;
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
#endif // NFD_DAEMON_TABLE_CS_ENTRY_HPP
diff --git a/daemon/table/cs-policy-lru.cpp b/daemon/table/cs-policy-lru.cpp
index 1b477aa..80b5994 100644
--- a/daemon/table/cs-policy-lru.cpp
+++ b/daemon/table/cs-policy-lru.cpp
@@ -26,9 +26,7 @@
#include "cs-policy-lru.hpp"
#include "cs.hpp"
-namespace nfd {
-namespace cs {
-namespace lru {
+namespace nfd::cs::lru {
const std::string LruPolicy::POLICY_NAME = "lru";
NFD_REGISTER_CS_POLICY(LruPolicy);
@@ -87,6 +85,4 @@
}
}
-} // namespace lru
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs::lru
diff --git a/daemon/table/cs-policy-lru.hpp b/daemon/table/cs-policy-lru.hpp
index 5d61e47..8d7c814 100644
--- a/daemon/table/cs-policy-lru.hpp
+++ b/daemon/table/cs-policy-lru.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
namespace lru {
using Queue = boost::multi_index_container<
@@ -84,7 +83,6 @@
using lru::LruPolicy;
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
#endif // NFD_DAEMON_TABLE_CS_POLICY_LRU_HPP
diff --git a/daemon/table/cs-policy-priority-fifo.cpp b/daemon/table/cs-policy-priority-fifo.cpp
index d037175..4405e66 100644
--- a/daemon/table/cs-policy-priority-fifo.cpp
+++ b/daemon/table/cs-policy-priority-fifo.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,9 +27,7 @@
#include "cs.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace cs {
-namespace priority_fifo {
+namespace nfd::cs::priority_fifo {
const std::string PriorityFifoPolicy::POLICY_NAME = "priority_fifo";
NFD_REGISTER_CS_POLICY(PriorityFifoPolicy);
@@ -158,6 +156,4 @@
m_entryInfoMap[i] = entryInfo;
}
-} // namespace priority_fifo
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs::priority_fifo
diff --git a/daemon/table/cs-policy-priority-fifo.hpp b/daemon/table/cs-policy-priority-fifo.hpp
index 757b0c5..48d1d66 100644
--- a/daemon/table/cs-policy-priority-fifo.hpp
+++ b/daemon/table/cs-policy-priority-fifo.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <list>
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
namespace priority_fifo {
using Queue = std::list<Policy::EntryRef>;
@@ -121,7 +120,6 @@
using priority_fifo::PriorityFifoPolicy;
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
#endif // NFD_DAEMON_TABLE_CS_POLICY_PRIORITY_FIFO_HPP
diff --git a/daemon/table/cs-policy.cpp b/daemon/table/cs-policy.cpp
index 6b24eb3..3e3fc53 100644
--- a/daemon/table/cs-policy.cpp
+++ b/daemon/table/cs-policy.cpp
@@ -32,8 +32,7 @@
NFD_LOG_INIT(CsPolicy);
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
Policy::Registry&
Policy::getRegistry()
@@ -100,5 +99,4 @@
this->doBeforeUse(i);
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/cs-policy.hpp b/daemon/table/cs-policy.hpp
index 9a4c6ed..de4c89c 100644
--- a/daemon/table/cs-policy.hpp
+++ b/daemon/table/cs-policy.hpp
@@ -28,8 +28,7 @@
#include "cs-entry.hpp"
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
class Cs;
@@ -206,8 +205,7 @@
Cs* m_cs;
};
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
/** \brief registers a CS policy
* \param P a subclass of nfd::cs::Policy
diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index 5fc8301..18d8fe2 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -25,13 +25,11 @@
#include "cs.hpp"
#include "common/logger.hpp"
-#include "core/algorithm.hpp"
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace cs {
+namespace nfd::cs {
NFD_LOG_INIT(ContentStore);
@@ -178,5 +176,4 @@
NFD_LOG_INFO((shouldServe ? "Enabling" : "Disabling") << " Data serving");
}
-} // namespace cs
-} // namespace nfd
+} // namespace nfd::cs
diff --git a/daemon/table/fib-entry.cpp b/daemon/table/fib-entry.cpp
index 71c2516..cb97ea2 100644
--- a/daemon/table/fib-entry.cpp
+++ b/daemon/table/fib-entry.cpp
@@ -25,8 +25,7 @@
#include "fib-entry.hpp"
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
Entry::Entry(const Name& prefix)
: m_prefix(prefix)
@@ -83,5 +82,4 @@
[] (const NextHop& a, const NextHop& b) { return a.getCost() < b.getCost(); });
}
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
diff --git a/daemon/table/fib-entry.hpp b/daemon/table/fib-entry.hpp
index facf248..13825b7 100644
--- a/daemon/table/fib-entry.hpp
+++ b/daemon/table/fib-entry.hpp
@@ -28,13 +28,11 @@
#include "fib-nexthop.hpp"
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace fib {
+namespace nfd::fib {
class Fib;
@@ -121,7 +119,6 @@
friend Fib;
};
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
#endif // NFD_DAEMON_TABLE_FIB_ENTRY_HPP
diff --git a/daemon/table/fib-nexthop.hpp b/daemon/table/fib-nexthop.hpp
index e03efda..b696cea 100644
--- a/daemon/table/fib-nexthop.hpp
+++ b/daemon/table/fib-nexthop.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "core/common.hpp"
#include "face/face.hpp"
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
/** \brief Represents a nexthop record in a FIB entry
*/
@@ -66,7 +65,6 @@
uint64_t m_cost = 0;
};
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
#endif // NFD_DAEMON_TABLE_FIB_NEXTHOP_HPP
diff --git a/daemon/table/fib.cpp b/daemon/table/fib.cpp
index c6c8f2c..f30b976 100644
--- a/daemon/table/fib.cpp
+++ b/daemon/table/fib.cpp
@@ -29,8 +29,7 @@
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace fib {
+namespace nfd::fib {
NDN_CXX_ASSERT_FORWARD_ITERATOR(Fib::const_iterator);
@@ -165,5 +164,4 @@
boost::adaptors::transformed(name_tree::GetTableEntry<Entry>(&name_tree::Entry::getFibEntry));
}
-} // namespace fib
-} // namespace nfd
+} // namespace nfd::fib
diff --git a/daemon/table/measurements-accessor.cpp b/daemon/table/measurements-accessor.cpp
index 68cf784..3206c2e 100644
--- a/daemon/table/measurements-accessor.cpp
+++ b/daemon/table/measurements-accessor.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016, Regents of the University of California,
+/*
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,14 +25,11 @@
#include "measurements-accessor.hpp"
-namespace nfd {
-namespace measurements {
-
-using fw::Strategy;
+namespace nfd::measurements {
MeasurementsAccessor::MeasurementsAccessor(Measurements& measurements,
const StrategyChoice& strategyChoice,
- const Strategy& strategy)
+ const fw::Strategy& strategy)
: m_measurements(measurements)
, m_strategyChoice(strategyChoice)
, m_strategy(&strategy)
@@ -50,12 +47,11 @@
return entry;
}
- Strategy& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
+ auto& effectiveStrategy = m_strategyChoice.findEffectiveStrategy(*entry);
if (&effectiveStrategy == m_strategy) {
return entry;
}
return nullptr;
}
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
diff --git a/daemon/table/measurements-entry.hpp b/daemon/table/measurements-entry.hpp
index a70f6e0..56825b6 100644
--- a/daemon/table/measurements-entry.hpp
+++ b/daemon/table/measurements-entry.hpp
@@ -28,13 +28,11 @@
#include "strategy-info-host.hpp"
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace measurements {
+namespace nfd::measurements {
class Measurements;
@@ -68,7 +66,6 @@
friend name_tree::Entry;
};
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
#endif // NFD_DAEMON_TABLE_MEASUREMENTS_ENTRY_HPP
diff --git a/daemon/table/measurements.cpp b/daemon/table/measurements.cpp
index af3cc1e..7a5f9b7 100644
--- a/daemon/table/measurements.cpp
+++ b/daemon/table/measurements.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "fib-entry.hpp"
#include "common/global.hpp"
-namespace nfd {
-namespace measurements {
+namespace nfd::measurements {
Measurements::Measurements(NameTree& nameTree)
: m_nameTree(nameTree)
@@ -150,5 +149,4 @@
--m_nItems;
}
-} // namespace measurements
-} // namespace nfd
+} // namespace nfd::measurements
diff --git a/daemon/table/name-tree-entry.cpp b/daemon/table/name-tree-entry.cpp
index c145129..a4f898b 100644
--- a/daemon/table/name-tree-entry.cpp
+++ b/daemon/table/name-tree-entry.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "name-tree-entry.hpp"
#include "name-tree.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
Entry::Entry(const Name& name, Node* node)
: m_name(name)
@@ -139,5 +138,4 @@
}
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-entry.hpp b/daemon/table/name-tree-entry.hpp
index 9c101ff..644d86b 100644
--- a/daemon/table/name-tree-entry.hpp
+++ b/daemon/table/name-tree-entry.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -31,8 +31,7 @@
#include "table/measurements-entry.hpp"
#include "table/strategy-choice-entry.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
class Node;
@@ -207,7 +206,6 @@
Getter m_getter;
};
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
#endif // NFD_DAEMON_TABLE_NAME_TREE_ENTRY_HPP
diff --git a/daemon/table/name-tree-hashtable.cpp b/daemon/table/name-tree-hashtable.cpp
index fc17523..390507d 100644
--- a/daemon/table/name-tree-hashtable.cpp
+++ b/daemon/table/name-tree-hashtable.cpp
@@ -27,8 +27,7 @@
#include "common/city-hash.hpp"
#include "common/logger.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
NFD_LOG_INIT(NameTreeHashtable);
@@ -278,5 +277,4 @@
this->computeThresholds();
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-hashtable.hpp b/daemon/table/name-tree-hashtable.hpp
index 2880984..de96d0a 100644
--- a/daemon/table/name-tree-hashtable.hpp
+++ b/daemon/table/name-tree-hashtable.hpp
@@ -28,8 +28,7 @@
#include "name-tree-entry.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
@@ -246,7 +245,6 @@
size_t m_shrinkThreshold;
};
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
#endif // NFD_DAEMON_TABLE_NAME_TREE_HASHTABLE_HPP
diff --git a/daemon/table/name-tree-iterator.cpp b/daemon/table/name-tree-iterator.cpp
index 33b5382..001bb06 100644
--- a/daemon/table/name-tree-iterator.cpp
+++ b/daemon/table/name-tree-iterator.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <boost/range/concepts.hpp>
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
BOOST_CONCEPT_ASSERT((boost::ForwardRangeConcept<Range>));
@@ -257,5 +256,4 @@
i = Iterator();
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/name-tree-iterator.hpp b/daemon/table/name-tree-iterator.hpp
index d99e5f9..fc04fb6 100644
--- a/daemon/table/name-tree-iterator.hpp
+++ b/daemon/table/name-tree-iterator.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2021, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "name-tree-hashtable.hpp"
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
class NameTree;
@@ -211,7 +210,6 @@
*/
using Range = boost::iterator_range<Iterator>;
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
#endif // NFD_DAEMON_TABLE_NAME_TREE_ITERATOR_HPP
diff --git a/daemon/table/name-tree.cpp b/daemon/table/name-tree.cpp
index aac885c..1758532 100644
--- a/daemon/table/name-tree.cpp
+++ b/daemon/table/name-tree.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -30,8 +30,7 @@
#include <boost/concept_check.hpp>
#include <type_traits>
-namespace nfd {
-namespace name_tree {
+namespace nfd::name_tree {
NFD_LOG_INIT(NameTree);
@@ -236,5 +235,4 @@
return {Iterator(make_shared<PartialEnumerationImpl>(*this, entrySubTreeSelector), entry), end()};
}
-} // namespace name_tree
-} // namespace nfd
+} // namespace nfd::name_tree
diff --git a/daemon/table/pit-entry.cpp b/daemon/table/pit-entry.cpp
index e2e194f..b302c28 100644
--- a/daemon/table/pit-entry.cpp
+++ b/daemon/table/pit-entry.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <algorithm>
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
Entry::Entry(const Interest& interest)
: m_interest(interest.shared_from_this())
@@ -120,5 +119,4 @@
}
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-entry.hpp b/daemon/table/pit-entry.hpp
index e088e70..6287e44 100644
--- a/daemon/table/pit-entry.hpp
+++ b/daemon/table/pit-entry.hpp
@@ -31,13 +31,11 @@
#include <list>
-namespace nfd {
-
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace pit {
+namespace nfd::pit {
/**
* \brief An unordered collection of in-records
@@ -246,7 +244,6 @@
friend name_tree::Entry;
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_ENTRY_HPP
diff --git a/daemon/table/pit-face-record.cpp b/daemon/table/pit-face-record.cpp
index 4674b8e..c0f43bc 100644
--- a/daemon/table/pit-face-record.cpp
+++ b/daemon/table/pit-face-record.cpp
@@ -25,8 +25,7 @@
#include "pit-face-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
// Impose a maximum lifetime to prevent integer overflow when calculating m_expiry.
const time::milliseconds MAX_LIFETIME = 10_days;
@@ -42,5 +41,4 @@
m_expiry = m_lastRenewed + lifetime;
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-face-record.hpp b/daemon/table/pit-face-record.hpp
index 1a68a51..edb0783 100644
--- a/daemon/table/pit-face-record.hpp
+++ b/daemon/table/pit-face-record.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,8 +29,7 @@
#include "face/face.hpp"
#include "strategy-info-host.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief Contains information about an Interest on an incoming or outgoing face
* \note This is an implementation detail to extract common functionality
@@ -84,7 +83,6 @@
time::steady_clock::TimePoint m_expiry = time::steady_clock::TimePoint::min();
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_FACE_RECORD_HPP
diff --git a/daemon/table/pit-in-record.cpp b/daemon/table/pit-in-record.cpp
index 15131da..6982780 100644
--- a/daemon/table/pit-in-record.cpp
+++ b/daemon/table/pit-in-record.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "pit-in-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
void
InRecord::update(const Interest& interest)
@@ -35,5 +34,4 @@
m_interest = interest.shared_from_this();
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-in-record.hpp b/daemon/table/pit-in-record.hpp
index 002537b..c61f61d 100644
--- a/daemon/table/pit-in-record.hpp
+++ b/daemon/table/pit-in-record.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "pit-face-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief Contains information about an Interest from an incoming face
*/
@@ -52,7 +51,6 @@
shared_ptr<const Interest> m_interest;
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_IN_RECORD_HPP
diff --git a/daemon/table/pit-iterator.cpp b/daemon/table/pit-iterator.cpp
index 58777a7..f0d0c8a 100644
--- a/daemon/table/pit-iterator.cpp
+++ b/daemon/table/pit-iterator.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2014-2018, Regents of the University of California,
+ * Copyright (c) 2014-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -27,8 +27,7 @@
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
NDN_CXX_ASSERT_FORWARD_ITERATOR(Iterator);
@@ -61,5 +60,4 @@
return copy;
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-iterator.hpp b/daemon/table/pit-iterator.hpp
index b788e3c..014ddc1 100644
--- a/daemon/table/pit-iterator.hpp
+++ b/daemon/table/pit-iterator.hpp
@@ -29,8 +29,7 @@
#include "name-tree.hpp"
#include "pit-entry.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief PIT iterator
*/
@@ -87,7 +86,6 @@
size_t m_iPitEntry; ///< current PIT entry within m_ntIt->getPitEntries()
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_ITERATOR_HPP
diff --git a/daemon/table/pit-out-record.cpp b/daemon/table/pit-out-record.cpp
index e86f440..1f3e899 100644
--- a/daemon/table/pit-out-record.cpp
+++ b/daemon/table/pit-out-record.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "pit-out-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
bool
OutRecord::setIncomingNack(const lp::Nack& nack)
@@ -39,5 +38,4 @@
return true;
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/pit-out-record.hpp b/daemon/table/pit-out-record.hpp
index 383e0c8..aeb7523 100644
--- a/daemon/table/pit-out-record.hpp
+++ b/daemon/table/pit-out-record.hpp
@@ -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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -28,8 +28,7 @@
#include "pit-face-record.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
/** \brief Contains information about an Interest toward an outgoing face
*/
@@ -75,7 +74,6 @@
unique_ptr<lp::NackHeader> m_incomingNack;
};
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
#endif // NFD_DAEMON_TABLE_PIT_OUT_RECORD_HPP
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index cc447f2..4ebdefb 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -25,8 +25,7 @@
#include "pit.hpp"
-namespace nfd {
-namespace pit {
+namespace nfd::pit {
static inline bool
nteHasPitEntries(const name_tree::Entry& nte)
@@ -128,5 +127,4 @@
return const_iterator(m_nameTree.fullEnumerate(&nteHasPitEntries).begin());
}
-} // namespace pit
-} // namespace nfd
+} // namespace nfd::pit
diff --git a/daemon/table/strategy-choice-entry.cpp b/daemon/table/strategy-choice-entry.cpp
index 1a1ea8e..a752e45 100644
--- a/daemon/table/strategy-choice-entry.cpp
+++ b/daemon/table/strategy-choice-entry.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -26,8 +26,7 @@
#include "strategy-choice-entry.hpp"
#include "fw/strategy.hpp"
-namespace nfd {
-namespace strategy_choice {
+namespace nfd::strategy_choice {
Entry::Entry(const Name& prefix)
: m_prefix(prefix)
@@ -48,5 +47,4 @@
m_strategy = std::move(strategy);
}
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
diff --git a/daemon/table/strategy-choice-entry.hpp b/daemon/table/strategy-choice-entry.hpp
index ac59234..a47337f 100644
--- a/daemon/table/strategy-choice-entry.hpp
+++ b/daemon/table/strategy-choice-entry.hpp
@@ -28,17 +28,15 @@
#include "core/common.hpp"
-namespace nfd {
-
-namespace fw {
+namespace nfd::fw {
class Strategy;
-} // namespace fw
+} // namespace nfd::fw
-namespace name_tree {
+namespace nfd::name_tree {
class Entry;
-} // namespace name_tree
+} // namespace nfd::name_tree
-namespace strategy_choice {
+namespace nfd::strategy_choice {
/**
* \brief Represents an entry in the %Strategy %Choice table.
@@ -85,7 +83,6 @@
friend name_tree::Entry;
};
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice
#endif // NFD_DAEMON_TABLE_STRATEGY_CHOICE_ENTRY_HPP
diff --git a/daemon/table/strategy-choice.cpp b/daemon/table/strategy-choice.cpp
index e03306c..cefb245 100644
--- a/daemon/table/strategy-choice.cpp
+++ b/daemon/table/strategy-choice.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-2022, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -32,8 +32,7 @@
#include <ndn-cxx/util/concepts.hpp>
-namespace nfd {
-namespace strategy_choice {
+namespace nfd::strategy_choice {
NDN_CXX_ASSERT_FORWARD_ITERATOR(StrategyChoice::const_iterator);
@@ -266,5 +265,4 @@
&name_tree::Entry::getStrategyChoiceEntry));
}
-} // namespace strategy_choice
-} // namespace nfd
+} // namespace nfd::strategy_choice