common.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014-2017, Regents of the University of California,
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  *
11  * This file is part of NFD (Named Data Networking Forwarding Daemon).
12  * See AUTHORS.md for complete list of NFD authors and contributors.
13  *
14  * NFD 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  * NFD 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  * NFD, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #ifndef NFD_CORE_COMMON_HPP
27 #define NFD_CORE_COMMON_HPP
28 
29 #include "core/config.hpp"
30 
31 #ifdef WITH_TESTS
32 #define VIRTUAL_WITH_TESTS virtual
33 #define PUBLIC_WITH_TESTS_ELSE_PROTECTED public
34 #define PUBLIC_WITH_TESTS_ELSE_PRIVATE public
35 #define PROTECTED_WITH_TESTS_ELSE_PRIVATE protected
36 #define FINAL_UNLESS_WITH_TESTS
37 #else
38 #define VIRTUAL_WITH_TESTS
39 #define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
40 #define PUBLIC_WITH_TESTS_ELSE_PRIVATE private
41 #define PROTECTED_WITH_TESTS_ELSE_PRIVATE private
42 #define FINAL_UNLESS_WITH_TESTS final
43 #endif
44 
45 #include <cstddef>
46 #include <cstdint>
47 #include <functional>
48 #include <limits>
49 #include <list>
50 #include <map>
51 #include <memory>
52 #include <set>
53 #include <string>
54 #include <unordered_map>
55 #include <unordered_set>
56 #include <utility>
57 #include <vector>
58 
59 #include <ndn-cxx/data.hpp>
60 #include <ndn-cxx/delegation.hpp>
61 #include <ndn-cxx/delegation-list.hpp>
62 #include <ndn-cxx/exclude.hpp>
63 #include <ndn-cxx/interest.hpp>
64 #include <ndn-cxx/name.hpp>
65 #include <ndn-cxx/encoding/block.hpp>
66 #include <ndn-cxx/lp/nack.hpp>
67 #include <ndn-cxx/net/face-uri.hpp>
68 #include <ndn-cxx/util/backports.hpp>
69 #include <ndn-cxx/util/signal.hpp>
70 
71 #include <boost/asio.hpp>
72 #include <boost/assert.hpp>
73 #include <boost/lexical_cast.hpp>
74 #include <boost/noncopyable.hpp>
75 #include <boost/property_tree/ptree.hpp>
76 #include <boost/throw_exception.hpp>
77 
78 namespace nfd {
79 
80 using std::size_t;
81 
82 using boost::noncopyable;
83 
84 using std::shared_ptr;
85 using std::unique_ptr;
86 using std::weak_ptr;
87 using std::make_shared;
88 using ndn::make_unique;
89 using std::enable_shared_from_this;
90 
91 using std::static_pointer_cast;
92 using std::dynamic_pointer_cast;
93 using std::const_pointer_cast;
94 
95 using std::function;
96 using std::bind;
97 using std::ref;
98 using std::cref;
99 
100 using ndn::to_string;
101 
102 using ndn::Block;
103 using ndn::Data;
104 using ndn::Delegation;
105 using ndn::DelegationList;
106 using ndn::Exclude;
107 using ndn::FaceUri;
108 using ndn::Interest;
109 using ndn::Name;
110 using ndn::PartialName;
111 
112 namespace tlv {
113 // Don't write "namespace tlv = ndn::tlv", because NFD can add other members into this namespace.
114 using namespace ndn::tlv;
115 } // namespace tlv
116 
117 namespace lp = ndn::lp;
118 namespace name = ndn::name;
119 namespace time = ndn::time;
120 namespace signal = ndn::util::signal;
121 
122 } // namespace nfd
123 
124 #endif // NFD_CORE_COMMON_HPP
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32