22 #ifndef NDN_INTEREST_HPP 23 #define NDN_INTEREST_HPP 73 template<encoding::Tag TAG>
157 return static_cast<bool>(m_nonce);
185 return m_interestLifetime;
198 return m_forwardingHint;
214 template<
typename Modifier>
218 modifier(m_forwardingHint);
230 return !m_selectors.
empty();
242 m_selectors = selectors;
335 time::milliseconds m_interestLifetime;
338 mutable Block m_wire;
355 return !(lhs == rhs);
360 #endif // NDN_INTEREST_HPP
int getMinSuffixComponents() const
const Block & wireEncode() const
Encode to a wire format.
bool hasWire() const
Check if the Block has fully encoded wire.
Copyright (c) 2011-2015 Regents of the University of California.
int getChildSelector() const
Interest & modifyForwardingHint(const Modifier &modifier)
modify ForwardingHint in-place
const Selectors & getSelectors() const
Interest & setMustBeFresh(bool mustBeFresh)
Selectors & setMustBeFresh(bool mustBeFresh)
std::string toUri() const
Encode the name according to the NDN URI Scheme.
int getMustBeFresh() const
void refreshNonce()
Refresh nonce.
std::ostream & operator<<(std::ostream &os, const Data &data)
bool matchesInterest(const Interest &other) const
Check if Interest matches other interest.
int getMustBeFresh() const
bool matchesName(const Name &name) const
Check if Interest, including selectors, matches the given name.
Represents a TLV element of NDN packet format.
represents an Interest packet
bool operator!=(const Data &lhs, const Data &rhs)
int getChildSelector() const
Selectors & setMaxSuffixComponents(int maxSuffixComponents)
bool hasNonce() const
Check if Nonce set.
Selectors & setExclude(const Exclude &exclude)
Selectors & setChildSelector(int childSelector)
set ChildSelector
int getMaxSuffixComponents() const
Selectors & setMinSuffixComponents(int minSuffixComponents)
Interest(const Name &name=Name(), time::milliseconds interestLifetime=DEFAULT_INTEREST_LIFETIME)
Create a new Interest with the given name and interest lifetime.
const KeyLocator & getPublisherPublicKeyLocator() const
const KeyLocator & getPublisherPublicKeyLocator() const
Error(const std::string &what)
Interest & setExclude(const Exclude &exclude)
Interest & setChildSelector(int childSelector)
Interest & setName(const Name &name)
uint32_t getNonce() const
Get nonce.
Interest & setNonce(uint32_t nonce)
Set nonce.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
base class to allow simple management of packet tags
Abstraction implementing Interest selectors.
Interest & setMinSuffixComponents(int minSuffixComponents)
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
Interest & setMaxSuffixComponents(int maxSuffixComponents)
void reset()
Reset wire buffer of the element.
Represents an absolute name.
const Exclude & getExclude() const
bool hasWire() const
Check if already has wire.
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Exclude)
Interest & setSelectors(const Selectors &selectors)
void wireDecode(const Block &wire)
Decode from the wire format.
int getMaxSuffixComponents() const
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
int getMinSuffixComponents() const
const Exclude & getExclude() const
Interest & setInterestLifetime(time::milliseconds interestLifetime)
Set Interest's lifetime.
time::milliseconds getInterestLifetime() const
const DelegationList & getForwardingHint() const
represents a list of Delegations
bool operator==(const Data &lhs, const Data &rhs)
Interest & setForwardingHint(const DelegationList &value)
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
Represents a Data packet.
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
bool hasSelectors() const
const Name & getName() const