NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
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-2018, 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 <map>
50 #include <memory>
51 #include <set>
52 #include <stdexcept>
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>
62 #include <ndn-cxx/interest.hpp>
63 #include <ndn-cxx/name.hpp>
65 #include <ndn-cxx/lp/nack.hpp>
66 #include <ndn-cxx/net/face-uri.hpp>
68 #include <ndn-cxx/util/signal.hpp>
69 
70 #include <boost/asio.hpp>
71 #include <boost/assert.hpp>
72 #include <boost/lexical_cast.hpp>
73 #include <boost/noncopyable.hpp>
74 #include <boost/property_tree/ptree.hpp>
75 #include <boost/throw_exception.hpp>
76 
77 namespace nfd {
78 
79 using std::size_t;
80 
81 using boost::noncopyable;
82 
83 using std::shared_ptr;
84 using std::unique_ptr;
85 using std::weak_ptr;
86 using std::make_shared;
87 using std::make_unique;
88 
89 using std::static_pointer_cast;
90 using std::dynamic_pointer_cast;
91 using std::const_pointer_cast;
92 
93 using std::bind;
94 
95 using namespace std::string_literals;
96 
97 using ndn::optional;
98 using ndn::nullopt;
99 using ndn::to_string;
100 
101 using ndn::Block;
102 using ndn::Data;
103 using ndn::Delegation;
104 using ndn::DelegationList;
105 using ndn::FaceUri;
106 using ndn::Interest;
107 using ndn::Name;
108 using ndn::PartialName;
109 
110 // Not using a namespace alias (namespace tlv = ndn::tlv), because
111 // it doesn't allow NFD to add other members to the namespace
112 namespace tlv {
113 using namespace ndn::tlv;
114 } // namespace tlv
115 
116 namespace lp = ndn::lp;
117 namespace name = ndn::name;
118 namespace signal = ndn::util::signal;
119 namespace time = ndn::time;
120 using namespace ndn::time_literals;
121 
122 } // namespace nfd
123 
124 #endif // NFD_CORE_COMMON_HPP
Represents a TLV element of NDN packet format.
Definition: block.hpp:42
represents a delegation
Definition: delegation.hpp:32
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
Name PartialName
Represents an arbitrary sequence of name components.
Definition: name.hpp:39
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
Namespace defining NDN Packet Format related constants and procedures.
Definition: tlv-nfd.hpp:29
represents a list of Delegations
std::string to_string(const V &v)
Definition: backports.hpp:67
const nullopt_t nullopt((nullopt_t::init()))