7 #ifndef NDN_DETAIL_REGISTERED_PREFIX_HPP
8 #define NDN_DETAIL_REGISTERED_PREFIX_HPP
10 #include "../common.hpp"
11 #include "../name.hpp"
12 #include "../interest.hpp"
19 typedef function<void (const Name&, const Interest&)>
OnInterest;
27 : m_prefix(new
Name(prefix))
28 , m_onInterest(onInterest)
45 shared_ptr<Name> m_prefix;
50 struct RegisteredPrefixId;
58 : m_id(registeredPrefixId)
63 operator()(
const shared_ptr<RegisteredPrefix>& registeredPrefix)
const
65 return (reinterpret_cast<const RegisteredPrefixId*>(registeredPrefix.get()) == m_id);
68 const RegisteredPrefixId* m_id;
73 #endif // NDN_DETAIL_REGISTERED_PREFIX_HPP
const OnInterest & getOnInterest() const
const Name & getPrefix() const
function< void(const Name &, const Interest &)> OnInterest
An OnInterest function object is used to pass a callback to registerPrefix.
bool operator()(const shared_ptr< RegisteredPrefix > ®isteredPrefix) const
Functor to match pending interests against PendingInterestId.
A Name holds an array of Name::Component and represents an NDN name.
function< void(const Name &, const Interest &)> OnInterest
MatchRegisteredPrefixId(const RegisteredPrefixId *registeredPrefixId)
RegisteredPrefix(const Name &prefix, const OnInterest &onInterest)
Create a new PrefixEntry.