ndn-cxx: NDN C++ Library 0.9.0-33-g832ea91d
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013-2024 Regents of the University of California.
4 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6 *
7 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20 */
21
29#ifndef NDN_CXX_DETAIL_COMMON_HPP
30#define NDN_CXX_DETAIL_COMMON_HPP
31
32#include "ndn-cxx/detail/config.hpp"
33
34// require C++17
35#if __cplusplus < 201703L
36#error "ndn-cxx applications must be compiled using the C++17 standard (-std=c++17)"
37#endif
38
39// ndn-cxx specific macros declared in this and other headers must have NDN_CXX_ prefix
40// to avoid conflicts with other projects that include ndn-cxx headers.
41#ifdef NDN_CXX_WITH_TESTS
42#define NDN_CXX_VIRTUAL_WITH_TESTS virtual
43#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED public
44#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE public
45#define NDN_CXX_PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
46#else
47#define NDN_CXX_VIRTUAL_WITH_TESTS
48#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
49#define NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE private
50#define NDN_CXX_PROTECTED_WITH_TESTS_ELSE_PRIVATE private
51#endif
52
53#include <cstddef>
54#include <cstdint>
55#include <functional>
56#include <iosfwd>
57#include <memory>
58#include <stdexcept>
59#include <string>
60#include <string_view>
61#include <type_traits>
62#include <utility>
63
64namespace ndn {
65
66using std::shared_ptr;
67using std::unique_ptr;
68using std::weak_ptr;
69using std::make_shared;
70using std::make_unique;
71
72using std::to_string;
73using namespace std::string_literals;
74using namespace std::string_view_literals;
75
76} // namespace ndn
77
78using namespace std::placeholders;
79
80#include <boost/version.hpp>
81
83// Bug 2109 workaround
84#if BOOST_VERSION < 107600
85#define BOOST_BIND_NO_PLACEHOLDERS
86#include <boost/is_placeholder.hpp>
87namespace boost {
88#define NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(N) \
89 template<> \
90 struct is_placeholder<std::remove_const_t<decltype(_##N)>> \
91 { \
92 enum _vt { \
93 value = N \
94 }; \
95 };
96NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(1)
97NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(2)
98NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(3)
99NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(4)
100NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(5)
101NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(6)
102NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(7)
103NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(8)
104NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER(9)
105#undef NDN_CXX_SPECIALIZE_BOOST_IS_PLACEHOLDER_FOR_STD_PLACEHOLDER
106} // namespace boost
107#endif // BOOST_VERSION < 107600
109
110#include <boost/assert.hpp>
111#include <boost/core/noncopyable.hpp>
112
113namespace ndn {
114using boost::noncopyable;
115} // namespace ndn
116
119
120#endif // NDN_CXX_DETAIL_COMMON_HPP
Definition data.cpp:25