Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 2 | /* |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame^] | 3 | * Copyright (c) 2014-2022, Regents of the University of California, |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 4 | * Arizona Board of Regents, |
| 5 | * Colorado State University, |
| 6 | * University Pierre & Marie Curie, Sorbonne University, |
| 7 | * Washington University in St. Louis, |
| 8 | * Beijing Institute of Technology, |
| 9 | * The University of Memphis. |
| 10 | * |
Junxiao Shi | 1688ded | 2015-03-29 10:09:26 -0700 | [diff] [blame] | 11 | * This file is part of ndn-tools (Named Data Networking Essential Tools). |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 12 | * See AUTHORS.md for complete list of ndn-tools authors and contributors. |
| 13 | * |
| 14 | * ndn-tools is free software: you can redistribute it and/or modify it under the terms |
| 15 | * of the GNU General Public License as published by the Free Software Foundation, |
| 16 | * either version 3 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
| 19 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 20 | * PURPOSE. See the GNU General Public License for more details. |
| 21 | * |
| 22 | * You should have received a copy of the GNU General Public License along with |
| 23 | * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>. |
| 24 | */ |
| 25 | |
| 26 | #ifndef NDN_TOOLS_CORE_COMMON_HPP |
| 27 | #define NDN_TOOLS_CORE_COMMON_HPP |
| 28 | |
Junxiao Shi | 2713a3b | 2015-06-22 16:19:05 -0700 | [diff] [blame] | 29 | #ifdef WITH_TESTS |
| 30 | #define VIRTUAL_WITH_TESTS virtual |
| 31 | #define PUBLIC_WITH_TESTS_ELSE_PROTECTED public |
| 32 | #define PUBLIC_WITH_TESTS_ELSE_PRIVATE public |
| 33 | #define PROTECTED_WITH_TESTS_ELSE_PRIVATE protected |
| 34 | #else |
| 35 | #define VIRTUAL_WITH_TESTS |
| 36 | #define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected |
| 37 | #define PUBLIC_WITH_TESTS_ELSE_PRIVATE private |
| 38 | #define PROTECTED_WITH_TESTS_ELSE_PRIVATE private |
| 39 | #endif |
| 40 | |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 41 | #include <cstddef> |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 42 | #include <cstdint> |
| 43 | #include <functional> |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 44 | #include <iostream> |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 45 | #include <limits> |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 46 | #include <memory> |
Davide Pesavento | c070270 | 2017-08-24 22:04:00 -0400 | [diff] [blame] | 47 | #include <stdexcept> |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 48 | #include <string> |
Davide Pesavento | b3570c6 | 2022-02-19 19:19:00 -0500 | [diff] [blame^] | 49 | #include <string_view> |
Davide Pesavento | c070270 | 2017-08-24 22:04:00 -0400 | [diff] [blame] | 50 | #include <utility> |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 51 | #include <vector> |
| 52 | |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 53 | #include <boost/assert.hpp> |
Davide Pesavento | b07d7a9 | 2020-05-13 23:30:07 -0400 | [diff] [blame] | 54 | #include <boost/core/noncopyable.hpp> |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 55 | #include <boost/lexical_cast.hpp> |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 56 | |
| 57 | #include <ndn-cxx/data.hpp> |
| 58 | #include <ndn-cxx/face.hpp> |
| 59 | #include <ndn-cxx/interest.hpp> |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 60 | #include <ndn-cxx/name.hpp> |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 61 | #include <ndn-cxx/security/key-chain.hpp> |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 62 | #include <ndn-cxx/util/backports.hpp> |
Davide Pesavento | 80baddf | 2019-02-23 15:51:59 -0500 | [diff] [blame] | 63 | #include <ndn-cxx/util/exception.hpp> |
Eric Newberry | 4164b8e | 2015-04-23 17:29:18 -0700 | [diff] [blame] | 64 | #include <ndn-cxx/util/scheduler.hpp> |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 65 | #include <ndn-cxx/util/time.hpp> |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 66 | |
| 67 | namespace ndn { |
| 68 | |
Davide Pesavento | 60f8cc1 | 2018-05-10 22:05:21 -0400 | [diff] [blame] | 69 | using std::shared_ptr; |
| 70 | using std::unique_ptr; |
| 71 | using std::make_shared; |
| 72 | using std::make_unique; |
| 73 | |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 74 | using std::size_t; |
| 75 | |
| 76 | using boost::noncopyable; |
| 77 | |
Junxiao Shi | 1753afb | 2015-04-17 20:59:50 -0700 | [diff] [blame] | 78 | } // namespace ndn |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 79 | |
Davide Pesavento | f8d9a53 | 2021-07-03 16:04:12 -0400 | [diff] [blame] | 80 | #define FORWARD_TO_MEM_FN(func) \ |
| 81 | [this] (auto&&... args) { this->func(std::forward<decltype(args)>(args)...); } |
| 82 | |
Junxiao Shi | f719124 | 2015-03-19 05:53:41 -0700 | [diff] [blame] | 83 | #endif // NDN_TOOLS_CORE_COMMON_HPP |