Select Default Language Display:

  • C++
  • Python
  • JavaScript
  • Java
  • All Languages

ptr_lib (C++)

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.

#include <memory>
namespace ndn { namespace ptr_lib = std; }
#include <boost/shared_ptr.hpp>
#include <boost/make_shared.hpp>
namespace ndn { namespace ptr_lib = boost; }
// Use the boost header files in this distribution.
#include <ndnboost/shared_ptr.hpp>
#include <ndnboost/make_shared.hpp>
namespace ndn { namespace ptr_lib = ndnboost; }

Time representation

Some methods use calendar time or a time interval. These are represented as follows.

Milliseconds Typedef

(C++ only) A time interval represented as the number of milliseconds.

[C++]:Namespace: ndn
typedef double Milliseconds;

MillisecondsSince1970 Typedef

(C++ only) The calendar time represented as the number of milliseconds since 1/1/1970.

[C++]:Namespace: ndn
typedef double MillisecondsSince1970;