22 #ifndef NDN_INTEREST_FILTER_HPP 23 #define NDN_INTEREST_FILTER_HPP 29 class RegexPatternListMatcher;
38 class Error :
public std::runtime_error
43 :
std::runtime_error(what)
102 operator const Name&()
const;
119 return m_regexFilter !=
nullptr;
125 return *m_regexFilter;
133 return m_allowsLoopback;
144 m_allowsLoopback = wantLoopback;
150 shared_ptr<RegexPatternListMatcher> m_regexFilter;
151 bool m_allowsLoopback =
true;
159 #endif // NDN_INTEREST_FILTER_HPP Copyright (c) 2013-2017 Regents of the University of California.
bool doesMatch(const Name &name) const
Check if specified Interest name matches the filter.
const RegexPatternListMatcher & getRegexFilter() const
InterestFilter & allowLoopback(bool wantLoopback)
Set whether Interest loopback is allowed.
std::ostream & operator<<(std::ostream &os, const Data &data)
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
Error(const std::string &what)
const Name & getPrefix() const
bool allowsLoopback() const
Get whether Interest loopback is allowed.
Represents an absolute name.
InterestFilter(const Name &prefix)
Construct an InterestFilter to match Interests by prefix.
bool hasRegexFilter() const