Alexander Afanasyev | 1122501 | 2013-11-21 23:11:10 -0800 | [diff] [blame^] | 1 | ptr_lib (C++) |
| 2 | ============= |
| 3 | |
| 4 | Some C++ methods need to use shared_ptr. Depending on where ./configure found shared_ptr, define the ptr_lib namespace as follows, so that the API always uses ndn::ptr_lib::shared_ptr. |
| 5 | |
| 6 | .. code-block:: c++ |
| 7 | |
| 8 | #if NDN_CPP_HAVE_STD_SHARED_PTR |
| 9 | #include |
| 10 | #include <memory> |
| 11 | namespace ndn { namespace ptr_lib = std; } |
| 12 | #elif NDN_CPP_HAVE_BOOST_SHARED_PTR |
| 13 | #include <boost/shared_ptr.hpp> |
| 14 | #include <boost/make_shared.hpp> |
| 15 | namespace ndn { namespace ptr_lib = boost; } |
| 16 | #else |
| 17 | // Use the boost header files in this distribution. |
| 18 | #include <ndnboost/shared_ptr.hpp> |
| 19 | #include <ndnboost/make_shared.hpp> |
| 20 | namespace ndn { namespace ptr_lib = ndnboost; } |
| 21 | #endif |
| 22 | |
| 23 | Time representation |
| 24 | =================== |
| 25 | |
| 26 | Some methods use calendar time or a time interval. These are represented as follows. |
| 27 | |
| 28 | Milliseconds Typedef |
| 29 | -------------------- |
| 30 | |
| 31 | (C++ only) A time interval represented as the number of milliseconds. |
| 32 | |
| 33 | :[C++]: |
| 34 | Namespace: `ndn` |
| 35 | |
| 36 | .. code-block:: c++ |
| 37 | |
| 38 | typedef double Milliseconds; |
| 39 | |
| 40 | MillisecondsSince1970 Typedef |
| 41 | ----------------------------- |
| 42 | |
| 43 | (C++ only) The calendar time represented as the number of milliseconds since 1/1/1970. |
| 44 | |
| 45 | :[C++]: |
| 46 | Namespace: ndn |
| 47 | |
| 48 | .. code-block:: c++ |
| 49 | |
| 50 | typedef double MillisecondsSince1970; |