22 #ifndef NDN_PREFIX_DISCOVERY_HPP
23 #define NDN_PREFIX_DISCOVERY_HPP
25 #include <ndn-cpp/face.hpp>
39 typedef ndn::func_lib::function<void
40 (
const ndn::ptr_lib::shared_ptr<std::vector<ndn::Name> >& prefixes)> OnPrefixes;
57 : impl_(
new Impl(onPrefixes, face, periodMilliseconds))
83 class Impl :
public ndn::ptr_lib::enable_shared_from_this<Impl> {
85 Impl(OnPrefixes onPrefixes,
ndn::Face* face,
87 : onPrefixes_(onPrefixes), face_(face),
88 periodMilliseconds_(periodMilliseconds), isEnabled_(false)
103 void stop() { isEnabled_ =
false; }
111 (
const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest,
112 const ndn::ptr_lib::shared_ptr<ndn::Data>& data);
115 onTimeout(
const ndn::ptr_lib::shared_ptr<const ndn::Interest>& interest);
117 OnPrefixes onPrefixes_;
120 std::vector<ndn::Name> prefixes_;
124 ndn::ptr_lib::shared_ptr<Impl> impl_;
double Milliseconds
A time interval represented as the number of milliseconds.
Definition: common.hpp:114
The Face class provides the main methods for NDN communication.
Definition: face.hpp:86