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 "
ndn-cxx/exclude.hpp
"
26
#include "
ndn-cxx/key-locator.hpp
"
27
28
namespace
ndn
{
29
30
const
int
DEFAULT_CHILD_SELECTOR
= 0;
31
35
class
Selectors
36
{
37
public
:
38
class
Error
:
public
tlv::Error
39
{
40
public
:
41
using
tlv::Error::Error;
42
};
43
44
Selectors
();
45
49
explicit
50
Selectors
(
const
Block
& wire);
51
52
bool
53
empty
()
const
;
54
58
template
<encoding::Tag TAG>
59
size_t
60
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
61
65
const
Block
&
66
wireEncode
()
const
;
67
71
void
72
wireDecode
(
const
Block
& wire);
73
74
public
:
// getters & setters
75
int
76
getMinSuffixComponents
()
const
77
{
78
return
m_minSuffixComponents;
79
}
80
81
Selectors
&
82
setMinSuffixComponents
(
int
minSuffixComponents);
83
84
int
85
getMaxSuffixComponents
()
const
86
{
87
return
m_maxSuffixComponents;
88
}
89
90
Selectors
&
91
setMaxSuffixComponents
(
int
maxSuffixComponents);
92
93
const
KeyLocator
&
94
getPublisherPublicKeyLocator
()
const
95
{
96
return
m_publisherPublicKeyLocator;
97
}
98
99
Selectors
&
100
setPublisherPublicKeyLocator
(
const
KeyLocator
& keyLocator);
101
102
const
Exclude
&
103
getExclude
()
const
104
{
105
return
m_exclude;
106
}
107
108
Selectors
&
109
setExclude
(
const
Exclude
& exclude);
110
111
int
112
getChildSelector
()
const
113
{
114
return
m_childSelector;
115
}
116
121
Selectors
&
122
setChildSelector
(
int
childSelector);
123
124
bool
125
getMustBeFresh
()
const
126
{
127
return
m_mustBeFresh;
128
}
129
130
Selectors
&
131
setMustBeFresh
(
bool
mustBeFresh);
132
133
public
:
// EqualityComparable concept
134
bool
135
operator==
(
const
Selectors
& other)
const
;
136
137
bool
138
operator!=
(
const
Selectors
& other)
const
139
{
140
return
!this->
operator==
(other);
141
}
142
143
private
:
144
int
m_minSuffixComponents;
145
int
m_maxSuffixComponents;
146
KeyLocator
m_publisherPublicKeyLocator;
147
Exclude
m_exclude;
148
int
m_childSelector;
149
bool
m_mustBeFresh;
150
151
mutable
Block
m_wire;
152
};
153
154
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
Selectors
);
155
156
}
// namespace ndn
157
158
#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:76
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::Selectors::Error
Definition:
selectors.hpp:38
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:30
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
ndn::Selectors::getMustBeFresh
bool getMustBeFresh() const
Definition:
selectors.hpp:125
ndn::Selectors::getChildSelector
int getChildSelector() const
Definition:
selectors.hpp:112
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:99
ndn::Selectors::setChildSelector
Selectors & setChildSelector(int childSelector)
set ChildSelector
Definition:
selectors.cpp:214
ndn::Selectors::setMinSuffixComponents
Selectors & setMinSuffixComponents(int minSuffixComponents)
Definition:
selectors.cpp:182
ndn::Selectors::getPublisherPublicKeyLocator
const KeyLocator & getPublisherPublicKeyLocator() const
Definition:
selectors.hpp:94
ndn::Selectors::operator!=
bool operator!=(const Selectors &other) const
Definition:
selectors.hpp:138
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:35
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:85
ndn::KeyLocator
Definition:
key-locator.hpp:30
ndn::Selectors::getExclude
const Exclude & getExclude() const
Definition:
selectors.hpp:103
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:52
ndn::Exclude
Represents Exclude selector in NDN Interest.
Definition:
exclude.hpp:43
ndn::Selectors::setPublisherPublicKeyLocator
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
Definition:
selectors.cpp:198
ndnSIM
ndn-cxx
ndn-cxx
selectors.hpp
Generated on Sun Feb 24 2019 22:16:06 for ndnSIM by
1.8.15