Use more C++17 features
Mainly structured bindings, inline variables, and class template
argument deduction, plus many more smaller things.
Change-Id: I810d17e0adb470426e4e30c898e03b3140ad052f
diff --git a/daemon/rib/service.cpp b/daemon/rib/service.cpp
index 0c674b3..d850ed2 100644
--- a/daemon/rib/service.cpp
+++ b/daemon/rib/service.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,
@@ -43,8 +43,6 @@
NFD_LOG_INIT(RibService);
-Service* Service::s_instance = nullptr;
-
const std::string CFG_RIB = "rib";
const std::string CFG_LOCALHOST_SECURITY = "localhost_security";
const std::string CFG_LOCALHOP_SECURITY = "localhop_security";
@@ -52,8 +50,8 @@
const std::string CFG_PREFIX_PROPAGATE = "auto_prefix_propagate";
const std::string CFG_READVERTISE_NLSR = "readvertise_nlsr";
const Name READVERTISE_NLSR_PREFIX = "/localhost/nlsr";
-const uint64_t PROPAGATE_DEFAULT_COST = 15;
-const time::milliseconds PROPAGATE_DEFAULT_TIMEOUT = 10_s;
+constexpr uint64_t PROPAGATE_DEFAULT_COST = 15;
+constexpr time::milliseconds PROPAGATE_DEFAULT_TIMEOUT = 10_s;
static ConfigSection
loadConfigSectionFromFile(const std::string& filename)
@@ -64,10 +62,7 @@
return config;
}
-/**
- * \brief Look into the config file and construct appropriate transport to communicate with NFD
- * If NFD-RIB instance was initialized with config file, INFO format is assumed
- */
+// Look into NFD's config file and construct an appropriate transport to communicate with NFD.
static shared_ptr<ndn::Transport>
makeLocalNfdTransport(const ConfigSection& config)
{