NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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 "../common.hpp"
26
#include "../name.hpp"
27
#include "../interest.hpp"
28
29
namespace
ndn
{
30
31
class
InterestFilterRecord
: noncopyable
32
{
33
public
:
34
typedef
function<void (const InterestFilter&, const Interest&)>
InterestCallback
;
35
36
InterestFilterRecord
(
const
InterestFilter
& filter,
const
InterestCallback& afterInterest)
37
: m_filter(filter)
38
, m_afterInterest(afterInterest)
39
{
40
}
41
46
bool
47
doesMatch
(
const
Name
&
name
)
const
48
{
49
return
m_filter.
doesMatch
(name);
50
}
51
56
void
57
invokeInterestCallback
(
const
Interest
& interest)
const
58
{
59
m_afterInterest(m_filter, interest);
60
}
61
62
const
InterestFilter
&
63
getFilter
()
const
64
{
65
return
m_filter;
66
}
67
68
private
:
69
InterestFilter
m_filter;
70
InterestCallback m_afterInterest;
71
};
72
73
77
class
InterestFilterId;
78
82
class
MatchInterestFilterId
83
{
84
public
:
85
explicit
86
MatchInterestFilterId
(
const
InterestFilterId* interestFilterId)
87
: m_id(interestFilterId)
88
{
89
}
90
91
bool
92
operator()
(
const
shared_ptr<InterestFilterRecord>& interestFilterId)
const
93
{
94
return
(reinterpret_cast<const InterestFilterId*>(interestFilterId.get()) == m_id);
95
}
96
private
:
97
const
InterestFilterId* m_id;
98
};
99
100
}
// namespace ndn
101
102
#endif // NDN_DETAIL_INTEREST_FILTER_RECORD_HPP
ndn::InterestFilterRecord::invokeInterestCallback
void invokeInterestCallback(const Interest &interest) const
invokes the InterestCallback
Definition:
interest-filter-record.hpp:57
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::InterestFilter
Definition:
interest-filter.hpp:31
ndn::InterestFilterRecord::getFilter
const InterestFilter & getFilter() const
Definition:
interest-filter-record.hpp:63
ndn::InterestFilterRecord
Definition:
interest-filter-record.hpp:31
ndn::Interest
represents an Interest packet
Definition:
interest.hpp:45
ndn::MatchInterestFilterId::MatchInterestFilterId
MatchInterestFilterId(const InterestFilterId *interestFilterId)
Definition:
interest-filter-record.hpp:86
ndn::InterestFilter::doesMatch
bool doesMatch(const Name &name) const
Check if specified name matches the filter.
Definition:
interest-filter.cpp:36
ndn::InterestFilterRecord::InterestCallback
function< void(const InterestFilter &, const Interest &)> InterestCallback
Definition:
interest-filter-record.hpp:34
ndn::MatchInterestFilterId
Functor to match InterestFilterId.
Definition:
interest-filter-record.hpp:82
ndn::Name
Name abstraction to represent an absolute name.
Definition:
name.hpp:46
ndn::MatchInterestFilterId::operator()
bool operator()(const shared_ptr< InterestFilterRecord > &interestFilterId) const
Definition:
interest-filter-record.hpp:92
ndn::InterestFilterRecord::InterestFilterRecord
InterestFilterRecord(const InterestFilter &filter, const InterestCallback &afterInterest)
Definition:
interest-filter-record.hpp:36
ndn::InterestFilterRecord::doesMatch
bool doesMatch(const Name &name) const
Check if Interest name matches the filter.
Definition:
interest-filter-record.hpp:47
ndn::name
Definition:
name-component.cpp:37
ndnSIM
ndn-cxx
src
detail
interest-filter-record.hpp
Generated on Sat Nov 12 2016 16:02:52 for ndnSIM by
1.8.12