detail: stop importing std::function into ndn namespace

Change-Id: I536774e974627abbf4e8b868ebb948b90ea5d4a6
This commit is contained in:
Davide Pesavento committed 2023-03-15 21:07:02 -04:00
1 parent 869d1a3c36
commit eb87c28200
19 files changed
+49 -33

No files matched your search

-2
View File
@@ -49,7 +49,6 @@
#define NDN_CXX_PROTECTED_WITH_TESTS_ELSE_PRIVATE private
#endif
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <functional>
@@ -72,7 +71,6 @@ using std::static_pointer_cast;
using std::dynamic_pointer_cast;
using std::const_pointer_cast;
using std::function;
using std::to_string;
using namespace std::string_literals;
+2
View File
@@ -31,6 +31,8 @@
#include <boost/asio/buffer.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <algorithm>
#include <cstring>
namespace ndn {
+3 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,6 +24,8 @@
#include "ndn-cxx/encoding/block.hpp"
#include <algorithm>
namespace ndn {
namespace encoding {
+9 -9
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -47,42 +47,42 @@ using RecordId = uint64_t;
/**
* @brief Callback invoked when an expressed Interest is satisfied by a Data packet
*/
typedef function<void(const Interest&, const Data&)> DataCallback;
using DataCallback = std::function<void(const Interest&, const Data&)>;
/**
* @brief Callback invoked when a Nack is received in response to an expressed Interest
*/
typedef function<void(const Interest&, const lp::Nack&)> NackCallback;
using NackCallback = std::function<void(const Interest&, const lp::Nack&)>;
/**
* @brief Callback invoked when an expressed Interest times out
*/
typedef function<void(const Interest&)> TimeoutCallback;
using TimeoutCallback = std::function<void(const Interest&)>;
/**
* @brief Callback invoked when an incoming Interest matches the specified InterestFilter
*/
typedef function<void(const InterestFilter&, const Interest&)> InterestCallback;
using InterestCallback = std::function<void(const InterestFilter&, const Interest&)>;
/**
* @brief Callback invoked when registerPrefix or setInterestFilter command succeeds
*/
typedef function<void(const Name&)> RegisterPrefixSuccessCallback;
using RegisterPrefixSuccessCallback = std::function<void(const Name&)>;
/**
* @brief Callback invoked when registerPrefix or setInterestFilter command fails
*/
typedef function<void(const Name&, const std::string&)> RegisterPrefixFailureCallback;
using RegisterPrefixFailureCallback = std::function<void(const Name&, const std::string&)>;
/**
* @brief Callback invoked when unregistering a prefix succeeds
*/
typedef function<void()> UnregisterPrefixSuccessCallback;
using UnregisterPrefixSuccessCallback = std::function<void()>;
/**
* @brief Callback invoked when unregistering a prefix fails
*/
typedef function<void(const std::string&)> UnregisterPrefixFailureCallback;
using UnregisterPrefixFailureCallback = std::function<void(const std::string&)>;
/**
* @brief Provide a communication channel with local or remote NDN forwarder
+1
View File
@@ -28,6 +28,7 @@
#include "ndn-cxx/detail/common.hpp"
// STL headers to precompile
#include <algorithm>
#include <atomic>
#include <iterator>
#include <limits>
+1
View File
@@ -29,6 +29,7 @@
#include <boost/range/adaptor/reversed.hpp>
#include <algorithm>
#include <cstring>
#include <sstream>
+3 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -21,6 +21,8 @@
#include "ndn-cxx/link.hpp"
#include <algorithm>
namespace ndn {
BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Link>));
+3 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -24,6 +24,8 @@
#include "ndn-cxx/data.hpp"
#include <initializer_list>
namespace ndn {
/**
+1
View File
@@ -22,6 +22,7 @@
#include "ndn-cxx/meta-info.hpp"
#include "ndn-cxx/encoding/block-helpers.hpp"
#include <algorithm>
#include <boost/range/adaptor/reversed.hpp>
namespace ndn {
+3 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2021 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -23,6 +23,8 @@
#include "ndn-cxx/lp/tags.hpp"
#include "ndn-cxx/util/logger.hpp"
#include <algorithm>
NDN_LOG_INIT(ndn.mgmt.Dispatcher);
namespace ndn {
+3 -3
View File
@@ -53,17 +53,17 @@ public:
/**
* \brief Callback on command success.
*/
using CommandSucceedCallback = function<void(const ControlParameters&)>;
using CommandSucceedCallback = std::function<void(const ControlParameters&)>;
/**
* \brief Callback on command failure.
*/
using CommandFailCallback = function<void(const ControlResponse&)>;
using CommandFailCallback = std::function<void(const ControlResponse&)>;
/**
* \brief Callback on dataset retrieval failure.
*/
using DatasetFailCallback = function<void(uint32_t code, const std::string& reason)>;
using DatasetFailCallback = std::function<void(uint32_t code, const std::string& reason)>;
/**
* \brief Construct a Controller that uses \p face as transport and \p keyChain to sign commands.
+5 -5
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2021 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -30,8 +30,8 @@
namespace ndn {
namespace dns {
typedef boost::asio::ip::address IpAddress;
typedef function<bool (const IpAddress& address)> AddressSelector;
using IpAddress = boost::asio::ip::address;
using AddressSelector = std::function<bool(const IpAddress&)>;
struct AnyAddress
{
@@ -66,8 +66,8 @@ public:
using std::runtime_error::runtime_error;
};
typedef function<void (const IpAddress& address)> SuccessCallback;
typedef function<void (const std::string& reason)> ErrorCallback;
using SuccessCallback = std::function<void(const IpAddress& address)>;
using ErrorCallback = std::function<void(const std::string& reason)>;
/** \brief Asynchronously resolve host
*
+2 -1
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2022 Regents of the University of California,
* Copyright (c) 2014-2023 Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & Marie Curie, Sorbonne University,
@@ -29,6 +29,7 @@
#include <boost/functional/hash.hpp>
#include <algorithm>
#include <cinttypes>
#include <cstdio>
#include <ostream>
+2 -2
View File
@@ -152,8 +152,8 @@ public: // canonical FaceUri
bool
isCanonical() const;
typedef function<void(const FaceUri&)> CanonizeSuccessCallback;
typedef function<void(const std::string& reason)> CanonizeFailureCallback;
using CanonizeSuccessCallback = std::function<void(const FaceUri&)>;
using CanonizeFailureCallback = std::function<void(const std::string& reason)>;
/** \brief Asynchronously convert this FaceUri to canonical form.
* \param onSuccess function to call after this FaceUri is converted to canonical form
+1
View File
@@ -35,6 +35,7 @@
#include <linux/rtnetlink.h>
#include <string.h>
#include <algorithm>
#include <cstring>
#include <map>
#include <optional>
+1
View File
@@ -24,6 +24,7 @@
#include "ndn-cxx/util/concepts.hpp"
#include "ndn-cxx/util/string-helper.hpp"
#include <algorithm>
#include <boost/range/adaptor/reversed.hpp>
namespace ndn {
+1
View File
@@ -31,6 +31,7 @@
#include <boost/lexical_cast.hpp>
#include <boost/range/adaptor/map.hpp>
#include <algorithm>
#include <cmath>
namespace ndn {
+4 -3
View File
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2013-2022 Regents of the University of California.
* Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -52,9 +52,10 @@ template<typename Owner, typename ...TArgs>
class Signal : noncopyable
{
public: // API for anyone
/** \brief Represents a function that can connect to the signal.
/**
* \brief Represents a function that can connect to the signal.
*/
typedef function<void(const TArgs&...)> Handler;
using Handler = std::function<void(const TArgs&...)>;
Signal();
+4 -4
View File
@@ -56,8 +56,8 @@ protected:
* \return whether the prefix registration succeeded.
*/
bool
runPrefixReg(function<void(const RegisterPrefixSuccessCallback& success,
const RegisterPrefixFailureCallback& failure)> f)
runPrefixReg(std::function<void(const RegisterPrefixSuccessCallback&,
const RegisterPrefixFailureCallback&)> f)
{
boost::logic::tribool result = boost::logic::indeterminate;
f([&] (auto) { result = true; },
@@ -72,8 +72,8 @@ protected:
* \return whether the prefix unregistration succeeded.
*/
bool
runPrefixUnreg(function<void(const UnregisterPrefixSuccessCallback& success,
const UnregisterPrefixFailureCallback& failure)> f)
runPrefixUnreg(std::function<void(const UnregisterPrefixSuccessCallback&,
const UnregisterPrefixFailureCallback&)> f)
{
boost::logic::tribool result = boost::logic::indeterminate;
f([&] { result = true; },