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);
113 Selectors::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>& encoder)
const;
116 Selectors::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>& encoder)
const;
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.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
prepend wire encoding
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)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
EncodingImpl< EstimatorTag > EncodingEstimator
element_const_iterator find(uint32_t type) const
void wireDecode(const Block &wire)
decode from wire encoding
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.
Selectors & setMaxSuffixComponents(int maxSuffixComponents)
element_const_iterator elements_end() const
Selectors & setExclude(const Exclude &exclude)
const KeyLocator & getPublisherPublicKeyLocator() const
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 Exclude & getExclude() const
EncodingImpl< EncoderTag > EncodingBuffer
int getChildSelector() 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.
int getMustBeFresh() const
Abstraction implementing Interest selectors.
element_container::const_iterator element_const_iterator
void reset()
Reset wire buffer of the element.
void parse() const
Parse wire buffer into subblocks.
bool operator==(const Selectors &other) const
bool empty() const
Check if exclude filter is empty.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
int getMinSuffixComponents() const
bool hasWire() const
Check if the Block has fully encoded wire.
a concept check for TLV abstraction with .wireEncode method
int getMaxSuffixComponents() const
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
represents an error in TLV encoding or decoding
Class to represent Exclude component in NDN interests.
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)