33 static_assert(std::is_base_of<tlv::Error, FaceQueryFilter::Error>::value,
34 "FaceQueryFilter::Error must inherit from tlv::Error");
38 , m_hasUriScheme(false)
39 , m_hasRemoteUri(false)
40 , m_hasLocalUri(false)
41 , m_hasFaceScope(false)
42 , m_hasFacePersistency(false)
43 , m_hasLinkType(false)
52 template<encoding::Tag TAG>
56 size_t totalLength = 0;
63 if (m_hasFacePersistency) {
75 reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size());
80 reinterpret_cast<const uint8_t*>(m_remoteUri.c_str()), m_remoteUri.size());
85 reinterpret_cast<const uint8_t*>(m_uriScheme.c_str()), m_uriScheme.size());
93 totalLength += encoder.prependVarNumber(totalLength);
99 FaceQueryFilter::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>&)
const;
102 FaceQueryFilter::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>&)
const;
116 m_wire = buffer.block();
125 BOOST_THROW_EXCEPTION(
Error(
"expecting FaceQueryFilter block"));
142 m_uriScheme.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
143 m_hasUriScheme =
true;
147 m_hasUriScheme =
false;
151 m_remoteUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
152 m_hasRemoteUri =
true;
156 m_hasRemoteUri =
false;
160 m_localUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
161 m_hasLocalUri =
true;
165 m_hasLocalUri =
false;
170 m_hasFaceScope =
true;
174 m_hasFaceScope =
false;
179 m_hasFacePersistency =
true;
183 m_hasFacePersistency =
false;
188 m_hasLinkType =
true;
192 m_hasLinkType =
false;
218 m_uriScheme = uriScheme;
219 m_hasUriScheme =
true;
227 m_hasUriScheme =
false;
235 m_remoteUri = remoteUri;
236 m_hasRemoteUri =
true;
244 m_hasRemoteUri =
false;
252 m_localUri = localUri;
253 m_hasLocalUri =
true;
261 m_hasLocalUri =
false;
269 m_faceScope = faceScope;
270 m_hasFaceScope =
true;
278 m_hasFaceScope =
false;
286 m_facePersistency = facePersistency;
287 m_hasFacePersistency =
true;
295 m_hasFacePersistency =
false;
303 m_linkType = linkType;
304 m_hasLinkType =
true;
312 m_hasLinkType =
false;
319 os <<
"FaceQueryFilter(";
321 os <<
"FaceID: " << filter.
getFaceId() <<
",\n";
333 os <<
"LocalUri: " << filter.
getLocalUri() <<
",\n";
345 os <<
"LinkType: " << filter.
getLinkType() <<
",\n";
const std::string & getUriScheme() const
Copyright (c) 2011-2015 Regents of the University of California.
FaceQueryFilter & unsetLocalUri()
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Helper to prepend TLV block type type containing non-negative integer value.
EncodingImpl< EstimatorTag > EncodingEstimator
Class representing a wire element of NDN-TLV packet format.
uint64_t readNonNegativeInteger(const Block &block)
Helper to read a non-negative integer from a block.
LinkType getLinkType() const
FaceQueryFilter & unsetFaceScope()
element_const_iterator elements_end() const
bool hasUriScheme() const
element_const_iterator elements_begin() const
FaceQueryFilter & setLocalUri(const std::string &localUri)
uint64_t getFaceId() const
bool hasFaceScope() const
const std::string & getLocalUri() const
EncodingImpl< EncoderTag > EncodingBuffer
FacePersistency getFacePersistency() const
Copyright (c) 2011-2015 Regents of the University of California.
FaceQueryFilter & setFaceScope(FaceScope faceScope)
FaceQueryFilter & unsetFaceId()
bool hasRemoteUri() const
element_container::const_iterator element_const_iterator
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
void reset()
Reset wire buffer of the element.
FaceQueryFilter & setUriScheme(const std::string &uriScheme)
const Block & wireEncode() const
encode FaceQueryFilter
FaceQueryFilter & unsetFacePersistency()
represents Face Query Filter
FaceQueryFilter & unsetUriScheme()
void parse() const
Parse wire buffer into subblocks.
const std::string & getRemoteUri() const
FaceQueryFilter & unsetRemoteUri()
FaceQueryFilter & setRemoteUri(const std::string &remoteUri)
FaceQueryFilter & setFaceId(uint64_t faceId)
bool hasWire() const
Check if the Block has fully encoded wire.
FaceQueryFilter & setLinkType(LinkType linkType)
FaceQueryFilter & setFacePersistency(FacePersistency facePersistency)
a concept check for TLV abstraction with .wireEncode method
void wireDecode(const Block &wire)
decode FaceQueryFilter
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
bool hasFacePersistency() const
FaceScope getFaceScope() const
FaceQueryFilter & unsetLinkType()