NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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; -*- */
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/interest.hpp>
60 #include <ndn-cxx/data.hpp>
61 #include <ndn-cxx/name.hpp>
62 #include <ndn-cxx/encoding/block.hpp>
63 #include <ndn-cxx/lp/nack.hpp>
64 #include <ndn-cxx/util/backports.hpp>
65 #include <ndn-cxx/util/face-uri.hpp>
66 #include <ndn-cxx/util/signal.hpp>
67 
68 #include <boost/asio.hpp>
69 #include <boost/assert.hpp>
70 #include <boost/lexical_cast.hpp>
71 #include <boost/noncopyable.hpp>
72 #include <boost/property_tree/ptree.hpp>
73 #include <boost/throw_exception.hpp>
74 
75 namespace nfd {
76 
77 using std::size_t;
78 
79 using boost::noncopyable;
80 
81 using std::shared_ptr;
82 using std::unique_ptr;
83 using std::weak_ptr;
84 using std::make_shared;
85 using ndn::make_unique;
86 using std::enable_shared_from_this;
87 
88 using std::static_pointer_cast;
89 using std::dynamic_pointer_cast;
90 using std::const_pointer_cast;
91 
92 using std::function;
93 using std::bind;
94 using std::ref;
95 using std::cref;
96 
97 using ndn::to_string;
98 
99 using ndn::Interest;
100 using ndn::Data;
101 using ndn::Name;
102 using ndn::PartialName;
103 using ndn::Exclude;
104 using ndn::Link;
105 using ndn::Block;
106 using ndn::util::FaceUri;
107 
108 namespace tlv {
109 // Don't write "namespace tlv = ndn::tlv", because NFD can add other members into this namespace.
110 using namespace ndn::tlv;
111 } // namespace tlv
112 
113 namespace lp = ndn::lp;
114 namespace name = ndn::name;
115 namespace time = ndn::time;
116 namespace signal = ndn::util::signal;
117 
118 } // namespace nfd
119 
120 #endif // NFD_CORE_COMMON_HPP
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
Class representing a wire element of NDN-TLV packet format.
Definition: block.hpp:43
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-common.hpp:40
Namespace defining NDN-TLV related constants and procedures.
Definition: tlv-nfd.hpp:29
Name PartialName
Partial name abstraction to represent an arbitrary sequence of name components.
Definition: name.hpp:36
std::string to_string(const V &v)
Definition: backports.hpp:51
unique_ptr< T > make_unique(Args &&... args)
Definition: backports.hpp:40