NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
face-query-filter.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2013-2017 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_MGMT_NFD_FACE_QUERY_FILTER_HPP
23
#define NDN_MGMT_NFD_FACE_QUERY_FILTER_HPP
24
25
#include "../../encoding/block.hpp"
26
#include "../../encoding/nfd-constants.hpp"
27
28
namespace
ndn
{
29
namespace
nfd
{
30
36
class
FaceQueryFilter
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
FaceQueryFilter
();
50
51
explicit
52
FaceQueryFilter
(
const
Block
& block);
53
56
template
<encoding::Tag TAG>
57
size_t
58
wireEncode
(
EncodingImpl<TAG>
& encoder)
const
;
59
62
const
Block
&
63
wireEncode
()
const
;
64
67
void
68
wireDecode
(
const
Block
& wire);
69
72
bool
73
empty
()
const
;
74
75
public
:
// getters & setters
76
bool
77
hasFaceId
()
const
78
{
79
return
!!m_faceId;
80
}
81
82
uint64_t
83
getFaceId
()
const
84
{
85
BOOST_ASSERT(this->
hasFaceId
());
86
return
*m_faceId;
87
}
88
89
FaceQueryFilter
&
90
setFaceId
(uint64_t faceId);
91
92
FaceQueryFilter
&
93
unsetFaceId
();
94
95
bool
96
hasUriScheme
()
const
97
{
98
return
!m_uriScheme.empty();
99
}
100
101
const
std::string&
102
getUriScheme
()
const
103
{
104
BOOST_ASSERT(this->
hasUriScheme
());
105
return
m_uriScheme;
106
}
107
108
FaceQueryFilter
&
109
setUriScheme
(
const
std::string& uriScheme);
110
111
FaceQueryFilter
&
112
unsetUriScheme
();
113
114
bool
115
hasRemoteUri
()
const
116
{
117
return
!m_remoteUri.empty();
118
}
119
120
const
std::string&
121
getRemoteUri
()
const
122
{
123
BOOST_ASSERT(this->
hasRemoteUri
());
124
return
m_remoteUri;
125
}
126
127
FaceQueryFilter
&
128
setRemoteUri
(
const
std::string& remoteUri);
129
130
FaceQueryFilter
&
131
unsetRemoteUri
();
132
133
bool
134
hasLocalUri
()
const
135
{
136
return
!m_localUri.empty();
137
}
138
139
const
std::string&
140
getLocalUri
()
const
141
{
142
BOOST_ASSERT(this->
hasLocalUri
());
143
return
m_localUri;
144
}
145
146
FaceQueryFilter
&
147
setLocalUri
(
const
std::string& localUri);
148
149
FaceQueryFilter
&
150
unsetLocalUri
();
151
152
bool
153
hasFaceScope
()
const
154
{
155
return
!!m_faceScope;
156
}
157
158
FaceScope
159
getFaceScope
()
const
160
{
161
BOOST_ASSERT(this->
hasFaceScope
());
162
return
*m_faceScope;
163
}
164
165
FaceQueryFilter
&
166
setFaceScope
(
FaceScope
faceScope);
167
168
FaceQueryFilter
&
169
unsetFaceScope
();
170
171
bool
172
hasFacePersistency
()
const
173
{
174
return
!!m_facePersistency;
175
}
176
177
FacePersistency
178
getFacePersistency
()
const
179
{
180
BOOST_ASSERT(this->
hasFacePersistency
());
181
return
*m_facePersistency;
182
}
183
184
FaceQueryFilter
&
185
setFacePersistency
(
FacePersistency
facePersistency);
186
187
FaceQueryFilter
&
188
unsetFacePersistency
();
189
190
bool
191
hasLinkType
()
const
192
{
193
return
!!m_linkType;
194
}
195
196
LinkType
197
getLinkType
()
const
198
{
199
BOOST_ASSERT(this->
hasLinkType
());
200
return
*m_linkType;
201
}
202
203
FaceQueryFilter
&
204
setLinkType
(
LinkType
linkType);
205
206
FaceQueryFilter
&
207
unsetLinkType
();
208
209
private
:
210
optional<uint64_t>
m_faceId;
211
std::string m_uriScheme;
212
std::string m_remoteUri;
213
std::string m_localUri;
214
optional<FaceScope>
m_faceScope;
215
optional<FacePersistency>
m_facePersistency;
216
optional<LinkType>
m_linkType;
217
218
mutable
Block
m_wire;
219
};
220
221
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
(
FaceQueryFilter
);
222
223
bool
224
operator==
(
const
FaceQueryFilter
& a,
const
FaceQueryFilter
& b);
225
226
inline
bool
227
operator!=
(
const
FaceQueryFilter
& a,
const
FaceQueryFilter
& b)
228
{
229
return
!(a == b);
230
}
231
232
std::ostream&
233
operator<<
(std::ostream& os,
const
FaceQueryFilter
& filter);
234
235
}
// namespace nfd
236
}
// namespace ndn
237
238
#endif // NDN_MGMT_NFD_FACE_QUERY_FILTER_HPP
ndn::nfd::FaceQueryFilter::getLinkType
LinkType getLinkType() const
Definition:
face-query-filter.hpp:197
ndn::nfd::FaceQueryFilter::hasFaceScope
bool hasFaceScope() const
Definition:
face-query-filter.hpp:153
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ndn::nfd::LinkType
LinkType
Definition:
nfd-constants.hpp:57
ndn::nfd::operator!=
bool operator!=(const ChannelStatus &a, const ChannelStatus &b)
Definition:
channel-status.hpp:85
ndn::nfd::FaceQueryFilter::unsetLocalUri
FaceQueryFilter & unsetLocalUri()
Definition:
face-query-filter.cpp:238
ndn::nfd::FaceQueryFilter::getLocalUri
const std::string & getLocalUri() const
Definition:
face-query-filter.hpp:140
ndn::tlv::nfd::FaceQueryFilter
Definition:
tlv-nfd.hpp:71
ndn::nfd::FaceQueryFilter::hasFaceId
bool hasFaceId() const
Definition:
face-query-filter.hpp:77
ndn::nfd::FaceQueryFilter::empty
bool empty() const
Definition:
face-query-filter.cpp:174
ndn::nfd::FaceQueryFilter::getFaceScope
FaceScope getFaceScope() const
Definition:
face-query-filter.hpp:159
ndn::optional< uint64_t >
ndn::Block
Represents a TLV element of NDN packet format.
Definition:
block.hpp:42
ndn::nfd::FaceQueryFilter::getRemoteUri
const std::string & getRemoteUri() const
Definition:
face-query-filter.hpp:121
ndn::nfd::FaceQueryFilter::hasRemoteUri
bool hasRemoteUri() const
Definition:
face-query-filter.hpp:115
ndn::nfd::FaceQueryFilter::Error
Definition:
face-query-filter.hpp:39
ndn::nfd::FaceQueryFilter::unsetFaceScope
FaceQueryFilter & unsetFaceScope()
Definition:
face-query-filter.cpp:252
ndn::nfd::FaceQueryFilter::FaceQueryFilter
FaceQueryFilter()
ndn::nfd::FacePersistency
FacePersistency
Definition:
nfd-constants.hpp:45
ndn::nfd::FaceScope
FaceScope
Definition:
nfd-constants.hpp:34
ndn::nfd::FaceQueryFilter::setLocalUri
FaceQueryFilter & setLocalUri(const std::string &localUri)
Definition:
face-query-filter.cpp:230
ndn::nfd::FaceQueryFilter::hasUriScheme
bool hasUriScheme() const
Definition:
face-query-filter.hpp:96
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::nfd::FaceQueryFilter::getFaceId
uint64_t getFaceId() const
Definition:
face-query-filter.hpp:83
ndn::nfd::operator==
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
Definition:
channel-status.cpp:96
ndn::nfd::FaceQueryFilter::wireEncode
const Block & wireEncode() const
encode FaceQueryFilter
Definition:
face-query-filter.cpp:89
ndn::nfd::FaceQueryFilter::hasLinkType
bool hasLinkType() const
Definition:
face-query-filter.hpp:191
ndn::nfd::FaceQueryFilter::setFaceScope
FaceQueryFilter & setFaceScope(FaceScope faceScope)
Definition:
face-query-filter.cpp:244
ndn::nfd::FaceQueryFilter::unsetFaceId
FaceQueryFilter & unsetFaceId()
Definition:
face-query-filter.cpp:194
ndn::nfd::operator<<
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
Definition:
nfd-constants.cpp:35
ndn::nfd::FaceQueryFilter::setUriScheme
FaceQueryFilter & setUriScheme(const std::string &uriScheme)
Definition:
face-query-filter.cpp:202
ndn::encoding::EncodingImpl
Definition:
encoding-buffer-fwd.hpp:36
ndn::nfd::FaceQueryFilter::hasLocalUri
bool hasLocalUri() const
Definition:
face-query-filter.hpp:134
ndn::nfd::FaceQueryFilter::unsetFacePersistency
FaceQueryFilter & unsetFacePersistency()
Definition:
face-query-filter.cpp:268
ndn::nfd::FaceQueryFilter
represents Face Query Filter
Definition:
face-query-filter.hpp:36
ndn::nfd::FaceQueryFilter::unsetUriScheme
FaceQueryFilter & unsetUriScheme()
Definition:
face-query-filter.cpp:210
ndn::nfd::FaceQueryFilter::unsetRemoteUri
FaceQueryFilter & unsetRemoteUri()
Definition:
face-query-filter.cpp:224
ndn::nfd::FaceQueryFilter::setRemoteUri
FaceQueryFilter & setRemoteUri(const std::string &remoteUri)
Definition:
face-query-filter.cpp:216
ndn::nfd::FaceQueryFilter::Error::Error
Error(const std::string &what)
Definition:
face-query-filter.hpp:43
ndn::nfd::FaceQueryFilter::setFaceId
FaceQueryFilter & setFaceId(uint64_t faceId)
Definition:
face-query-filter.cpp:186
ndn::nfd::NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ChannelStatus)
ndn::nfd::FaceQueryFilter::getUriScheme
const std::string & getUriScheme() const
Definition:
face-query-filter.hpp:102
ndn::nfd::FaceQueryFilter::setLinkType
FaceQueryFilter & setLinkType(LinkType linkType)
Definition:
face-query-filter.cpp:276
ndn::nfd::FaceQueryFilter::setFacePersistency
FaceQueryFilter & setFacePersistency(FacePersistency facePersistency)
Definition:
face-query-filter.cpp:260
ndn::nfd::FaceQueryFilter::getFacePersistency
FacePersistency getFacePersistency() const
Definition:
face-query-filter.hpp:178
ndn::nfd::FaceQueryFilter::hasFacePersistency
bool hasFacePersistency() const
Definition:
face-query-filter.hpp:172
ndn::nfd::FaceQueryFilter::wireDecode
void wireDecode(const Block &wire)
decode FaceQueryFilter
Definition:
face-query-filter.cpp:105
ndn::tlv::Error
represents an error in TLV encoding or decoding
Definition:
tlv.hpp:50
ndn::nfd::FaceQueryFilter::unsetLinkType
FaceQueryFilter & unsetLinkType()
Definition:
face-query-filter.cpp:284
ndnSIM
ndn-cxx
src
mgmt
nfd
face-query-filter.hpp
Generated on Sun Feb 25 2018 13:27:05 for ndnSIM by
1.8.14