NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
interest-filter-record.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
#ifndef NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
23
#define NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
24
25
#include "../name.hpp"
26
#include "../interest.hpp"
27
28
namespace
ndn
{
29
33
class
InterestFilterRecord
: noncopyable
34
{
35
public
:
42
InterestFilterRecord
(
const
InterestFilter
& filter,
43
const
InterestCallback
& interestCallback)
44
: m_filter(filter)
45
, m_interestCallback(interestCallback)
46
{
47
}
48
52
const
InterestFilter
&
53
getFilter
()
const
54
{
55
return
m_filter;
56
}
57
62
bool
63
doesMatch
(
const
Name
&
name
)
const
64
{
65
return
m_filter.
doesMatch
(name);
66
}
67
72
void
73
invokeInterestCallback
(
const
Interest
& interest)
const
74
{
75
if
(m_interestCallback !=
nullptr
) {
76
m_interestCallback(m_filter, interest);
77
}
78
}
79
80
private
:
81
InterestFilter
m_filter;
82
InterestCallback
m_interestCallback;
83
};
84
88
class
InterestFilterId;
89
93
class
MatchInterestFilterId
94
{
95
public
:
96
explicit
97
MatchInterestFilterId
(
const
InterestFilterId* interestFilterId)
98
: m_id(interestFilterId)
99
{
100
}
101
102
bool
103
operator()
(
const
shared_ptr<InterestFilterRecord>& interestFilterId)
const
104
{
105
return
reinterpret_cast<
const
InterestFilterId*
>
(interestFilterId.get()) == m_id;
106
}
107
108
private
:
109
const
InterestFilterId* m_id;
110
};
111
112
}
// namespace ndn
113
114
#endif // NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
ndn::InterestFilterRecord::invokeInterestCallback
void invokeInterestCallback(const Interest &interest) const
invokes the InterestCallback
Definition:
interest-filter-record.hpp:73
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::InterestFilterRecord::InterestFilterRecord
InterestFilterRecord(const InterestFilter &filter, const InterestCallback &interestCallback)
Construct an Interest filter record.
Definition:
interest-filter-record.hpp:42
ndn::InterestFilter
declares the set of Interests a producer can serve, which starts with a name prefix, plus an optional regular expression
Definition:
interest-filter.hpp:35
ndn::InterestFilterRecord::getFilter
const InterestFilter & getFilter() const
Definition:
interest-filter-record.hpp:53
ndn::InterestFilterRecord
associates an InterestFilter with Interest callback
Definition:
interest-filter-record.hpp:33
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:42
ndn::MatchInterestFilterId::MatchInterestFilterId
MatchInterestFilterId(const InterestFilterId *interestFilterId)
Definition:
interest-filter-record.hpp:97
ndn::InterestFilter::doesMatch
bool doesMatch(const Name &name) const
Check if specified Interest name matches the filter.
Definition:
interest-filter.cpp:58
ndn::MatchInterestFilterId
Functor to match InterestFilterId.
Definition:
interest-filter-record.hpp:93
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::InterestCallback
function< void(const InterestFilter &, const Interest &)> InterestCallback
Callback invoked when incoming Interest matches the specified InterestFilter.
Definition:
face.hpp:94
ndn::MatchInterestFilterId::operator()
bool operator()(const shared_ptr< InterestFilterRecord > &interestFilterId) const
Definition:
interest-filter-record.hpp:103
ndn::InterestFilterRecord::doesMatch
bool doesMatch(const Name &name) const
Check if Interest name matches the filter.
Definition:
interest-filter-record.hpp:63
ndn::name
Definition:
name-component.cpp:36
ndnSIM
ndn-cxx
src
detail
interest-filter-record.hpp
Generated on Wed Jan 11 2017 18:17:13 for ndnSIM by
1.8.13