core: drop std::function and ndn::Exclude from common.hpp, add ndn::optional
Change-Id: Ie3983d8b6f9929430efd8ada8d942e3f95755cd4
diff --git a/core/common.hpp b/core/common.hpp
index cde5437..156d59d 100644
--- a/core/common.hpp
+++ b/core/common.hpp
@@ -59,7 +59,6 @@
#include <ndn-cxx/data.hpp>
#include <ndn-cxx/delegation.hpp>
#include <ndn-cxx/delegation-list.hpp>
-#include <ndn-cxx/exclude.hpp>
#include <ndn-cxx/interest.hpp>
#include <ndn-cxx/name.hpp>
#include <ndn-cxx/encoding/block.hpp>
@@ -92,18 +91,18 @@
using std::dynamic_pointer_cast;
using std::const_pointer_cast;
-using std::function;
using std::bind;
-using std::ref;
using std::cref;
+using std::ref;
+using ndn::optional;
+using ndn::nullopt;
using ndn::to_string;
using ndn::Block;
using ndn::Data;
using ndn::Delegation;
using ndn::DelegationList;
-using ndn::Exclude;
using ndn::FaceUri;
using ndn::Interest;
using ndn::Name;
diff --git a/core/config-file.hpp b/core/config-file.hpp
index 363c66d..d51b1e9 100644
--- a/core/config-file.hpp
+++ b/core/config-file.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-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -34,24 +34,23 @@
/** \brief a config file section
*/
-typedef boost::property_tree::ptree ConfigSection;
+using ConfigSection = boost::property_tree::ptree;
/** \brief an optional config file section
*/
-typedef boost::optional<const ConfigSection&> OptionalConfigSection;
+using OptionalConfigSection = boost::optional<const ConfigSection&>;
/** \brief callback to process a config file section
*/
-typedef function<void(const ConfigSection& section,
- bool isDryRun,
- const std::string& filename)> ConfigSectionHandler;
+using ConfigSectionHandler = std::function<void(const ConfigSection& section, bool isDryRun,
+ const std::string& filename)>;
/** \brief callback to process a config file section without a \p ConfigSectionHandler
*/
-typedef function<void(const std::string& filename,
- const std::string& sectionName,
- const ConfigSection& section,
- bool isDryRun)> UnknownConfigSectionHandler;
+using UnknownConfigSectionHandler = std::function<void(const std::string& filename,
+ const std::string& sectionName,
+ const ConfigSection& section,
+ bool isDryRun)>;
/** \brief configuration file parsing utility
*/
diff --git a/core/manager-base.hpp b/core/manager-base.hpp
index 3d0a465..cddb7c1 100644
--- a/core/manager-base.hpp
+++ b/core/manager-base.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-2018, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -72,10 +72,10 @@
PUBLIC_WITH_TESTS_ELSE_PROTECTED: // registrations to the dispatcher
// difference from mgmt::ControlCommand: accepts nfd::ControlParameters
- typedef function<void(const ControlCommand& command,
- const Name& prefix, const Interest& interest,
- const ControlParameters& parameters,
- const ndn::mgmt::CommandContinuation done)> ControlCommandHandler;
+ using ControlCommandHandler = std::function<void(const ControlCommand& command,
+ const Name& prefix, const Interest& interest,
+ const ControlParameters& parameters,
+ const ndn::mgmt::CommandContinuation done)>;
template<typename Command>
void