All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
common.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
8 #ifndef NDN_COMMON_HPP
9 #define NDN_COMMON_HPP
10 
11 #include "ndn-cpp-config.hpp"
12 #include <stdint.h>
13 // TODO: Is stddef.h portable?
14 #include <stddef.h>
15 #include <unistd.h>
16 
17 // Standard headers to precompile
18 
19 #include <vector>
20 #include <list>
21 #include <set>
22 #include <algorithm>
23 #include <map>
24 #include <sstream>
25 #include <fstream>
26 #include <exception>
27 #include <map>
28 
29 // Other useful headers to precompile
30 #include <boost/lexical_cast.hpp>
31 #include <boost/asio.hpp>
32 #include <boost/date_time/posix_time/posix_time.hpp>
33 #include <boost/utility.hpp>
34 
35 #include <boost/iostreams/detail/ios.hpp>
36 #include <boost/iostreams/categories.hpp>
37 #include <boost/iostreams/stream.hpp>
38 
39 #if defined(__GNUC__) || defined(__clang__)
40 #define DEPRECATED(func) func __attribute__ ((deprecated))
41 #elif defined(_MSC_VER)
42 #define DEPRECATED(func) __declspec(deprecated) func
43 #else
44 #pragma message("DEPRECATED not implemented")
45 #define DEPRECATED(func) func
46 #endif
47 
48 #ifdef NDN_CPP_HAVE_CXX11
49 
50 #if defined(__GNUC__)
51 # if !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
52 # error "NDN-CPP-DEV library is configured and compiled in C++11 mode, but the current compiler is not C++11 enabled"
53 # endif // !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
54 #endif // defined(__GNUC__)
55 
56 #if defined(__clang__) && __cplusplus < 201103L
57 # error "NDN-CPP-DEV library is configured and compiled in C++11 mode, but the current compiler is not C++11 enabled"
58 #endif // defined(__clang__) && (__cplusplus < 201103L)
59 
60 
61 #include <memory>
62 #include <functional>
63 
64 namespace ndn {
65 
66 namespace ptr_lib = std;
67 namespace func_lib = std;
68 
69 using std::shared_ptr;
70 using std::weak_ptr;
71 using std::make_shared;
72 using std::enable_shared_from_this;
73 
74 using std::static_pointer_cast;
75 using std::dynamic_pointer_cast;
76 using std::const_pointer_cast;
77 
78 using std::function;
79 using std::bind;
80 using std::placeholders; // _1, _2, ..
81 
82 } // namespace ndn
83 
84 
85 #else
86 
87 #include <boost/shared_ptr.hpp>
88 #include <boost/weak_ptr.hpp>
89 #include <boost/enable_shared_from_this.hpp>
90 #include <boost/make_shared.hpp>
91 
92 #include <boost/function.hpp>
93 #include <boost/bind.hpp>
94 
95 namespace ndn {
96 
97 namespace ptr_lib = boost;
98 namespace func_lib = boost;
99 
100 using boost::shared_ptr;
101 using boost::weak_ptr;
102 using boost::make_shared;
103 using boost::enable_shared_from_this;
104 
105 using boost::static_pointer_cast;
106 using boost::dynamic_pointer_cast;
107 using boost::const_pointer_cast;
108 
109 using boost::function;
110 using boost::bind;
111 
112 } // namespace ndn
113 
114 #endif // NDN_CPP_HAVE_CXX11
115 
116 namespace ndn {
117 
118 using boost::noncopyable;
119 
120 }
121 
122 #include "util/time.hpp"
123 
124 #endif