An InterestFilter holds a Name prefix and optional regex match expression for use in Face::setInterestFilter.
More...
#include <interest-filter.hpp>
An InterestFilter holds a Name prefix and optional regex match expression for use in Face::setInterestFilter.
ndn::InterestFilter::InterestFilter |
( |
const Name & |
prefix | ) |
|
|
inline |
Create an InterestFilter to match any Interest whose name starts with the given prefix.
- Parameters
-
prefix | The prefix Name. This makes a copy of the Name. |
ndn::InterestFilter::InterestFilter |
( |
const std::string & |
prefixUri | ) |
|
|
inline |
Create an InterestFilter to match any Interest whose name starts with the given prefix.
- Parameters
-
prefixUri | The URI of the prefix Name. |
ndn::InterestFilter::InterestFilter |
( |
const char * |
prefixUri | ) |
|
|
inline |
Create an InterestFilter to match any Interest whose name starts with the given prefix.
- Parameters
-
prefixUri | The URI of the prefix Name. |
ndn::InterestFilter::InterestFilter |
( |
const Name & |
prefix, |
|
|
const std::string & |
regexFilter |
|
) |
| |
Create an InterestFilter to match any Interest whose name starts with the given prefix and the remaining components match the regexFilter regular expression as described in doesMatch.
- Parameters
-
prefix | The prefix Name. This makes a copy of the Name. |
regexFilter | The regular expression for matching the remaining name components. |
ndn::InterestFilter::InterestFilter |
( |
const Name & |
prefix, |
|
|
const char * |
regexFilter |
|
) |
| |
Create an InterestFilter to match any Interest whose name starts with the given prefix URI and the remaining components match the regexFilter regular expression as described in doesMatch.
- Parameters
-
prefix | The prefix Name. This makes a copy of the Name. |
regexFilter | The regular expression for matching the remaining name components. |
ndn::InterestFilter::InterestFilter |
( |
const std::string & |
prefixUri, |
|
|
const std::string & |
regexFilter |
|
) |
| |
Create an InterestFilter to match any Interest whose name starts with the given prefix URI and the remaining components match the regexFilter regular expression as described in doesMatch.
- Parameters
-
prefixUri | The URI of the prefix Name. |
regexFilter | The regular expression for matching the remaining name components. |
ndn::InterestFilter::InterestFilter |
( |
const char * |
prefixUri, |
|
|
const std::string & |
regexFilter |
|
) |
| |
Create an InterestFilter to match any Interest whose name starts with the given prefix URI and the remaining components match the regexFilter regular expression as described in doesMatch.
- Parameters
-
prefixUri | The URI of the prefix Name. |
regexFilter | The regular expression for matching the remaining name components. |
ndn::InterestFilter::InterestFilter |
( |
const std::string & |
prefixUri, |
|
|
const char * |
regexFilter |
|
) |
| |
Create an InterestFilter to match any Interest whose name starts with the given prefix URI and the remaining components match the regexFilter regular expression as described in doesMatch.
- Parameters
-
prefixUri | The URI of the prefix Name. |
regexFilter | The regular expression for matching the remaining name components. |
ndn::InterestFilter::InterestFilter |
( |
const char * |
prefixUri, |
|
|
const char * |
regexFilter |
|
) |
| |
Create an InterestFilter to match any Interest whose name starts with the given prefix URI and the remaining components match the regexFilter regular expression as described in doesMatch.
- Parameters
-
prefixUri | The URI of the prefix Name. |
regexFilter | The regular expression for matching the remaining name components. |
bool ndn::InterestFilter::doesMatch |
( |
const Name & |
name | ) |
const |
Check if the given name matches this filter.
Match if name starts with this filter's prefix. If this filter has the optional regexFilter then the remaining components match the regexFilter regular expression. For example, the following InterestFilter:
InterestFilter("/hello", "<world><>+")
will match all Interests, whose name has the prefix /hello
which is followed by a component world
and has at least one more component after it. Examples:
/hello/world/! /hello/world/x/y/z
Note that the regular expression will need to match all remaining components (e.g., there are implicit heading ^
and trailing $
symbols in the regular expression).
- Parameters
-
name | The name to check against this filter. |
- Returns
- True if name matches this filter, otherwise false.
const Name& ndn::InterestFilter::getPrefix |
( |
| ) |
const |
|
inline |
Get the prefix given to the constructor.
- Returns
- The prefix Name.
const std::string& ndn::InterestFilter::getRegexFilter |
( |
| ) |
const |
|
inline |
Get the regex filter.
This is only valid if hasRegexFilter()is true.
- Returns
- The regular expression for matching the remaining name components.
bool ndn::InterestFilter::hasRegexFilter |
( |
| ) |
const |
|
inline |
Check if a regexFilter was supplied to the constructor.
- Returns
- True if a regexFilter was supplied to the constructor.
The documentation for this class was generated from the following files: