28 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Selectors>));
32 static_assert(std::is_base_of<tlv::Error, Selectors::Error>::value,
33 "Selectors::Error must inherit from tlv::Error");
36 : m_minSuffixComponents(-1)
37 , m_maxSuffixComponents(-1)
39 , m_mustBeFresh(false)
51 return m_minSuffixComponents < 0 &&
52 m_maxSuffixComponents < 0 &&
53 m_publisherPublicKeyLocator.
empty() &&
55 m_childSelector < 0 &&
59 template<encoding::Tag TAG>
63 size_t totalLength = 0;
107 totalLength += encoder.prependVarNumber(totalLength);
130 m_wire = buffer.block();
138 BOOST_THROW_EXCEPTION(
tlv::Error(
"Unexpected TLV type when decoding Selectors"));
178 m_mustBeFresh =
true;
185 m_minSuffixComponents = minSuffixComponents;
193 m_maxSuffixComponents = maxSuffixComponents;
201 m_publisherPublicKeyLocator = keyLocator;
217 m_childSelector = childSelector;
225 m_mustBeFresh = mustBeFresh;
void wireDecode(const Block &wire)
Decode the input from wire format.
int getMinSuffixComponents() const
bool hasWire() const
Check if the Block has fully encoded wire.
Copyright (c) 2011-2015 Regents of the University of California.
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Helper to prepend TLV block type type containing non-negative integer value.
Selectors & setMustBeFresh(bool mustBeFresh)
EncodingImpl< EstimatorTag > EncodingEstimator
int getMustBeFresh() const
void wireDecode(const Block &wire)
decode from wire encoding
element_const_iterator elements_end() const
void parse() const
Parse wire buffer into subblocks.
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.
int getChildSelector() const
Selectors & setMaxSuffixComponents(int maxSuffixComponents)
Selectors & setExclude(const Exclude &exclude)
Selectors & setChildSelector(int childSelector)
Selectors & setMinSuffixComponents(int minSuffixComponents)
a concept check for TLV abstraction with .wireEncode method
void wireDecode(const Block &wire)
Decode from the wire format.
const KeyLocator & getPublisherPublicKeyLocator() const
EncodingImpl< EncoderTag > EncodingBuffer
element_const_iterator find(uint32_t type) const
size_t prependEmptyBlock(EncodingImpl< TAG > &encoder, uint32_t type)
Helper to prepend TLV block type type containing no value (i.e., a boolean block) ...
const Block & wireEncode() const
Encode to a wire format.
Abstraction implementing Interest selectors.
element_container::const_iterator element_const_iterator
void reset()
Reset wire buffer of the element.
bool operator==(const Selectors &other) const
int getMaxSuffixComponents() const
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend wire encoding
const Exclude & getExclude() const
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
a concept check for TLV abstraction with .wireEncode method
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)