22 #ifndef NDN_INTEREST_HPP 23 #define NDN_INTEREST_HPP 72 template<encoding::Tag TAG>
207 return m_forwardingHint;
223 template<
typename Modifier>
227 modifier(m_forwardingHint);
237 return static_cast<bool>(m_nonce);
263 return m_interestLifetime;
279 return !m_selectors.
empty();
293 m_selectors = selectors;
397 time::milliseconds m_interestLifetime;
400 mutable Block m_wire;
417 return !(lhs == rhs);
422 #endif // NDN_INTEREST_HPP
NDN_CXX_DEPRECATED Interest & setExclude(const Exclude &exclude)
int getMinSuffixComponents() const
const Block & wireEncode() const
Encode to a Block.
bool hasWire() const
Check if the Block has fully encoded wire.
Copyright (c) 2011-2015 Regents of the University of California.
Interest & modifyForwardingHint(const Modifier &modifier)
Modify ForwardingHint in-place.
Interest & setMustBeFresh(bool mustBeFresh)
Add or remove MustBeFresh element.
Selectors & setMustBeFresh(bool mustBeFresh)
std::string toUri() const
Return a URI-like string that represents the Interest.
void refreshNonce()
Change nonce value.
std::ostream & operator<<(std::ostream &os, const Data &data)
Interest(const Name &name=Name(), time::milliseconds lifetime=DEFAULT_INTEREST_LIFETIME)
Construct an Interest with given name and lifetime.
bool matchesInterest(const Interest &other) const
Check if Interest matches other interest.
NDN_CXX_DEPRECATED Interest & setChildSelector(int childSelector)
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)
NDN_CXX_DEPRECATED Interest & setSelectors(const Selectors &selectors)
bool getMustBeFresh() const
int getChildSelector() const
Selectors & setMaxSuffixComponents(int maxSuffixComponents)
bool hasNonce() const
Check if the Nonce element is present.
Selectors & setExclude(const Exclude &exclude)
Selectors & setChildSelector(int childSelector)
set ChildSelector
Selectors & setMinSuffixComponents(int minSuffixComponents)
NDN_CXX_DEPRECATED Interest & setMinSuffixComponents(int minSuffixComponents)
const KeyLocator & getPublisherPublicKeyLocator() const
NDN_CXX_DEPRECATED int getMinSuffixComponents() const
Error(const std::string &what)
Interest & setName(const Name &name)
uint32_t getNonce() const
Get nonce value.
NDN_CXX_DEPRECATED const Selectors & getSelectors() const
NDN_CXX_DEPRECATED Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
Interest & setNonce(uint32_t nonce)
Set nonce value.
base class to allow simple management of packet tags
Abstraction implementing Interest selectors.
NDN_CXX_DEPRECATED const Exclude & getExclude() const
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
void reset()
Reset wire buffer of the element.
Represents an absolute name.
bool getCanBePrefix() const
Check whether the CanBePrefix element is present.
bool hasWire() const
Check if this instance has cached wire encoding.
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Exclude)
NDN_CXX_DEPRECATED Interest & setMaxSuffixComponents(int maxSuffixComponents)
void wireDecode(const Block &wire)
Decode from wire in NDN Packet Format v0.2 or v0.3.
int getMaxSuffixComponents() const
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Prepend wire encoding to encoder in NDN Packet Format v0.2.
const Exclude & getExclude() const
NDN_CXX_DEPRECATED int getChildSelector() const
time::milliseconds getInterestLifetime() const
NDN_CXX_DEPRECATED bool hasSelectors() const
Check if Interest has any selector present.
const DelegationList & getForwardingHint() const
represents a list of Delegations
bool operator==(const Data &lhs, const Data &rhs)
Interest & setForwardingHint(const DelegationList &value)
bool getMustBeFresh() const
Check whether the MustBeFresh element is present.
Interest & setInterestLifetime(time::milliseconds lifetime)
Set Interest's lifetime.
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
#define NDN_CXX_DEPRECATED
Mark a type, variable, or function as deprecated.
NDN_CXX_DEPRECATED const KeyLocator & getPublisherPublicKeyLocator() const
Represents a Data packet.
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
const Name & getName() const
Interest & setCanBePrefix(bool canBePrefix)
Add or remove CanBePrefix element.
NDN_CXX_DEPRECATED int getMaxSuffixComponents() const