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; -*- */
26 #ifndef NFD_COMMON_HPP
27 #define NFD_COMMON_HPP
28 
29 #include "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 #else
37 #define VIRTUAL_WITH_TESTS
38 #define PUBLIC_WITH_TESTS_ELSE_PROTECTED protected
39 #define PUBLIC_WITH_TESTS_ELSE_PRIVATE private
40 #define PROTECTED_WITH_TESTS_ELSE_PRIVATE private
41 #endif
42 
46 #ifdef HAVE_CXX_OVERRIDE
47 #define DECL_OVERRIDE override
48 #else
49 #define DECL_OVERRIDE
50 #endif
51 
52 #include <cstddef>
53 #include <list>
54 #include <map>
55 #include <set>
56 #include <queue>
57 #include <unordered_map>
58 #include <unordered_set>
59 #include <vector>
60 #include <string>
61 
62 #include <ndn-cxx/common.hpp>
63 #include <ndn-cxx/interest.hpp>
64 #include <ndn-cxx/data.hpp>
65 #include <ndn-cxx/util/face-uri.hpp>
66 #include <ndn-cxx/util/signal.hpp>
67 
68 #include <boost/algorithm/string.hpp>
69 #include <boost/asio.hpp>
70 #include <boost/assert.hpp>
71 #include <boost/lexical_cast.hpp>
72 #include <boost/noncopyable.hpp>
73 #include <boost/property_tree/ptree.hpp>
74 #include <boost/throw_exception.hpp>
75 
76 namespace nfd {
77 
78 using std::size_t;
79 
80 using boost::noncopyable;
81 
82 using std::shared_ptr;
83 using std::unique_ptr;
84 using std::weak_ptr;
85 using std::make_shared;
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::Interest;
98 using ndn::Data;
99 using ndn::Name;
100 using ndn::Exclude;
101 using ndn::Block;
102 using ndn::util::FaceUri;
103 
104 namespace tlv {
105 // Don't write "namespace tlv = ndn::tlv", because NFD can add other members into this namespace.
106 using namespace ndn::tlv;
107 } // namespace tlv
108 
109 namespace name = ndn::name;
110 namespace time = ndn::time;
111 namespace signal = ndn::util::signal;
112 
113 } // namespace nfd
114 
115 // Some platforms are missing std::to_string (issue #2743)
116 #ifndef HAVE_STD_TO_STRING
117 namespace std {
118 template<typename V>
119 inline std::string
120 to_string(const V& v)
121 {
122  return boost::lexical_cast<std::string>(v);
123 }
124 } // namespace std
125 #endif // HAVE_STD_TO_STRING
126 
127 
128 #endif // NFD_COMMON_HPP
represents the underlying protocol and address used by a Face
Definition: face-uri.hpp:44
STL namespace.
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
std::string to_string(const V &v)
Definition: common.hpp:120