NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
selectors.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2018 Regents of the University of California.
4
*
5
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
6
*
7
* ndn-cxx library is free software: you can redistribute it and/or modify it under the
8
* terms of the GNU Lesser General Public License as published by the Free Software
9
* Foundation, either version 3 of the License, or (at your option) any later version.
10
*
11
* ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14
*
15
* You should have received copies of the GNU General Public License and GNU Lesser
16
* General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17
* <http://www.gnu.org/licenses/>.
18
*
19
* See AUTHORS.md for complete list of ndn-cxx authors and contributors.
20
*/
21
22
#ifndef NDN_SELECTORS_HPP
23
#define NDN_SELECTORS_HPP
24
25
#include "
common.hpp
"
26
#include "
key-locator.hpp
"
27
#include "
exclude.hpp
"
28
29
namespace
ndn
{
30
31
const
int
DEFAULT_CHILD_SELECTOR
= 0;
32
36
class
Selectors
37
{
38
public
:
39
class
Error
:
public
tlv::Error
40
{
41
public
:
42
explicit
43
Error
(
const
std::string& what)
44
: tlv::
Error
(what)
45
{
46
}
47
};
48
49
Selectors
();
50
54
explicit
55
Selectors
(
const
Block
& wire);
56
57
bool
58
empty
()
const
;
59
63
template
<encoding::Tag TAG>
64
size_t
65
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
66
70
const
Block
&
71
wireEncode
()
const
;
72
76
void
77
wireDecode
(
const
Block
& wire);
78
79
public
:
// getters & setters
80
int
81
getMinSuffixComponents
()
const
82
{
83
return
m_minSuffixComponents;
84
}
85
86
Selectors
&
87
setMinSuffixComponents
(
int
minSuffixComponents);
88
89
int
90
getMaxSuffixComponents
()
const
91
{
92
return
m_maxSuffixComponents;
93
}
94
95
Selectors
&
96
setMaxSuffixComponents
(
int
maxSuffixComponents);
97
98
const
KeyLocator
&
99
getPublisherPublicKeyLocator
()
const
100
{
101
return
m_publisherPublicKeyLocator;
102
}
103
104
Selectors
&
105
setPublisherPublicKeyLocator
(
const
KeyLocator
& keyLocator);
106
107
const
Exclude
&
108
getExclude
()
const
109
{
110
return
m_exclude;
111
}
112
113
Selectors
&
114
setExclude
(
const
Exclude
& exclude);
115
116
int
117
getChildSelector
()
const
118
{
119
return
m_childSelector;
120
}
121
126
Selectors
&
127
setChildSelector
(
int
childSelector);
128
129
bool
130
getMustBeFresh
()
const
131
{
132
return
m_mustBeFresh;
133
}
134
135
Selectors
&
136
setMustBeFresh
(
bool
mustBeFresh);
137
138
public
:
// EqualityComparable concept
139
bool
140
operator==
(
const
Selectors
& other)
const
;
141
142
bool
143
operator!=
(
const
Selectors
& other)
const
144
{
145
return
!this->
operator==
(other);
146
}
147
148
private
:
149
int
m_minSuffixComponents;
150
int
m_maxSuffixComponents;
151
KeyLocator
m_publisherPublicKeyLocator;
152
Exclude
m_exclude;
153
int
m_childSelector;
154
bool
m_mustBeFresh;
155
156
mutable
Block
m_wire;
157
};
158
159
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
Selectors
);
160
161
}
// namespace ndn
162
163
#endif // NDN_SELECTORS_HPP
ndn::Selectors::wireDecode
void wireDecode(const Block &wire)
Decode the input from wire format.
Definition:
selectors.cpp:131
ndn::Selectors::getMinSuffixComponents
int getMinSuffixComponents() const
Definition:
selectors.hpp:81
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::Selectors::Error
Definition:
selectors.hpp:39
ndn::Selectors::setMustBeFresh
Selectors & setMustBeFresh(bool mustBeFresh)
Definition:
selectors.cpp:225
ndn::Selectors::empty
bool empty() const
Definition:
selectors.cpp:49
exclude.hpp
ndn::DEFAULT_CHILD_SELECTOR
const int DEFAULT_CHILD_SELECTOR
Definition:
selectors.hpp:31
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
common.hpp
import common constructs for ndn-cxx library internal use
ndn::Selectors::getMustBeFresh
bool getMustBeFresh() const
Definition:
selectors.hpp:130
ndn::Selectors::getChildSelector
int getChildSelector() const
Definition:
selectors.hpp:117
ndn::Selectors::setMaxSuffixComponents
Selectors & setMaxSuffixComponents(int maxSuffixComponents)
Definition:
selectors.cpp:190
ndn::Selectors::setExclude
Selectors & setExclude(const Exclude &exclude)
Definition:
selectors.cpp:206
ndn::tlv::Selectors
Definition:
tlv.hpp:100
ndn::Selectors::setChildSelector
Selectors & setChildSelector(int childSelector)
set ChildSelector
Definition:
selectors.cpp:214
ndn::Selectors::Error::Error
Error(const std::string &what)
Definition:
selectors.hpp:43
ndn::Selectors::setMinSuffixComponents
Selectors & setMinSuffixComponents(int minSuffixComponents)
Definition:
selectors.cpp:182
ndn::Selectors::getPublisherPublicKeyLocator
const KeyLocator & getPublisherPublicKeyLocator() const
Definition:
selectors.hpp:99
ndn::Selectors::operator!=
bool operator!=(const Selectors &other) const
Definition:
selectors.hpp:143
ndn::Selectors::wireEncode
const Block & wireEncode() const
Encode to a wire format.
Definition:
selectors.cpp:115
ndn::Selectors
Abstraction implementing Interest selectors.
Definition:
selectors.hpp:36
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:36
ndn::Selectors::operator==
bool operator==(const Selectors &other) const
Definition:
selectors.cpp:233
ndn::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Exclude)
ndn::Selectors::getMaxSuffixComponents
int getMaxSuffixComponents() const
Definition:
selectors.hpp:90
ndn::KeyLocator
Definition:
key-locator.hpp:30
ndn::Selectors::getExclude
const Exclude & getExclude() const
Definition:
selectors.hpp:108
ndn::Selectors::Selectors
Selectors()
Definition:
selectors.cpp:35
key-locator.hpp
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndn::Exclude
Represents Exclude selector in NDN Interest.
Definition:
exclude.hpp:42
ndn::Selectors::setPublisherPublicKeyLocator
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
Definition:
selectors.cpp:198
ndnSIM
ndn-cxx
src
selectors.hpp
Generated on Tue Aug 7 2018 16:19:17 for ndnSIM by
1.8.14