NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::InterestFilter Class Reference

#include <interest-filter.hpp>

Classes

class  Error
 

Public Member Functions

 InterestFilter (const Name &prefix)
 Create an Interest filter to match Interests by prefix. More...
 
 InterestFilter (const char *prefixUri)
 Create an Interest filter to match Interests by prefix URI. More...
 
 InterestFilter (const std::string &prefixUri)
 Create an Interest filter to match Interests by prefix URI. More...
 
 InterestFilter (const Name &prefix, const std::string &regexFilter)
 Create an Interest filter to match Interest by prefix and regular expression. More...
 
 operator const Name & () const
 Implicit conversion to Name (to provide backwards compatibility for onInterest callback) More...
 
bool doesMatch (const Name &name) const
 Check if specified name matches the filter. More...
 
const NamegetPrefix () const
 
bool hasRegexFilter () const
 
const RegexPatternListMatchergetRegexFilter () const
 

Detailed Description

Definition at line 31 of file interest-filter.hpp.

Constructor & Destructor Documentation

§ InterestFilter() [1/4]

ndn::InterestFilter::InterestFilter ( const Name prefix)
inline

Create an Interest filter to match Interests by prefix.

This filter will match all Interests, whose name start with the given prefix

Any Name can be implicitly converted to the InterestFilter.

Definition at line 137 of file interest-filter.hpp.

Referenced by ndn::InterestFilter::Error::Error().

§ InterestFilter() [2/4]

ndn::InterestFilter::InterestFilter ( const char *  prefixUri)
inline

Create an Interest filter to match Interests by prefix URI.

This filter will match all Interests, whose name start with the given prefix

Any const char* can be implicitly converted to the InterestFilter.

Definition at line 143 of file interest-filter.hpp.

§ InterestFilter() [3/4]

ndn::InterestFilter::InterestFilter ( const std::string &  prefixUri)
inline

Create an Interest filter to match Interests by prefix URI.

This filter will match all Interests, whose name start with the given prefix

Any std::string can be implicitly converted to the InterestFilter.

Definition at line 149 of file interest-filter.hpp.

§ InterestFilter() [4/4]

ndn::InterestFilter::InterestFilter ( const Name prefix,
const std::string &  regexFilter 
)

Create an Interest filter to match Interest by prefix and regular expression.

This filter will match all Interests, whose name start with the given prefix and other components of the Interest name match the given regular expression. For example, the following InterestFilter:

InterestFilter("/hello", "<world><>+")

will match all Interests, whose name has prefix /hello, which is followed by component world and has at least one more component after it. Examples:

/hello/world/! /hello/world/x/y/z

Note that regular expression will need to match all components (e.g., there is an implicit heading ^ and trailing $ symbols in the regular expression).

Definition at line 28 of file interest-filter.cpp.

Member Function Documentation

§ operator const Name &()

ndn::InterestFilter::operator const Name & ( ) const
inline

Implicit conversion to Name (to provide backwards compatibility for onInterest callback)

Definition at line 94 of file interest-filter.hpp.

References doesMatch(), and ndn::InterestFilter::Error::Error().

§ doesMatch()

bool ndn::InterestFilter::doesMatch ( const Name name) const

Check if specified name matches the filter.

Definition at line 36 of file interest-filter.cpp.

References hasRegexFilter(), ndn::Name::isPrefixOf(), and ndn::Name::size().

Referenced by ndn::InterestFilterRecord::doesMatch(), and operator const Name &().

§ getPrefix()

const Name& ndn::InterestFilter::getPrefix ( ) const
inline

Definition at line 110 of file interest-filter.hpp.

Referenced by ndn::operator<<().

§ hasRegexFilter()

bool ndn::InterestFilter::hasRegexFilter ( ) const
inline

Definition at line 116 of file interest-filter.hpp.

Referenced by doesMatch(), and ndn::operator<<().

§ getRegexFilter()

const RegexPatternListMatcher& ndn::InterestFilter::getRegexFilter ( ) const
inline

Definition at line 122 of file interest-filter.hpp.

References ndn::operator<<().

Referenced by ndn::operator<<().


The documentation for this class was generated from the following files: