22 #ifndef NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
23 #define NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
25 #include "../name.hpp"
26 #include "../interest.hpp"
45 , m_interestCallback(interestCallback)
75 if (m_interestCallback !=
nullptr) {
76 m_interestCallback(m_filter, interest);
88 class InterestFilterId;
98 : m_id(interestFilterId)
103 operator()(
const shared_ptr<InterestFilterRecord>& interestFilterId)
const
105 return reinterpret_cast<const InterestFilterId*
>(interestFilterId.get()) == m_id;
109 const InterestFilterId* m_id;
114 #endif // NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
Copyright (c) 2013-2016 Regents of the University of California.
bool doesMatch(const Name &name) const
Check if specified Interest name matches the filter.
InterestFilterRecord(const InterestFilter &filter, const InterestCallback &interestCallback)
Construct an Interest filter record.
void invokeInterestCallback(const Interest &interest) const
invokes the InterestCallback
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
associates an InterestFilter with Interest callback
represents an Interest packet
MatchInterestFilterId(const InterestFilterId *interestFilterId)
const InterestFilter & getFilter() const
Functor to match InterestFilterId.
bool doesMatch(const Name &name) const
Check if Interest name matches the filter.
Name abstraction to represent an absolute name.
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
bool operator()(const shared_ptr< InterestFilterRecord > &interestFilterId) const