22 #ifndef NDN_INTEREST_HPP 23 #define NDN_INTEREST_HPP 75 Interest(
const Name& name,
const time::milliseconds& interestLifetime);
87 template<encoding::Tag TAG>
109 return m_wire.hasWire();
228 const time::milliseconds&
231 return m_interestLifetime;
237 m_interestLifetime = interestLifetime;
247 return m_nonce.hasWire();
282 return !m_selectors.empty();
294 m_selectors = selectors;
302 return m_selectors.getMinSuffixComponents();
316 return m_selectors.getMaxSuffixComponents();
330 return m_selectors.getPublisherPublicKeyLocator();
344 return m_selectors.getExclude();
358 return m_selectors.getChildSelector();
372 return m_selectors.getMustBeFresh();
393 return !(*
this == other);
399 mutable Block m_nonce;
400 time::milliseconds m_interestLifetime;
402 mutable Block m_link;
403 mutable shared_ptr<Link> m_linkCached;
404 size_t m_selectedDelegationIndex;
405 mutable Block m_wire;
414 std::ostringstream os;
421 #endif // NDN_INTEREST_HPP const Block & wireEncode() const
Encode to a wire format.
Copyright (c) 2011-2015 Regents of the University of California.
int getChildSelector() const
bool operator==(const Interest &other) const
const Selectors & getSelectors() const
Interest & setMustBeFresh(bool mustBeFresh)
void setSelectedDelegation(const Name &delegationName)
Set the selected delegation.
const Link & getLink() const
Get the link object for this interest.
std::string toUri() const
Encode the name according to the NDN URI Scheme.
int getMustBeFresh() const
Base class to store tag information (e.g., inside Interest and Data packets)
void refreshNonce()
Refresh nonce.
std::ostream & operator<<(std::ostream &os, const Data &data)
bool matchesName(const Name &name) const
Check if Interest, including selectors, matches the given name.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
bool hasNonce() const
Check if Nonce set.
void unsetSelectedDelegation()
Unset the selected delegation.
int getMaxSuffixComponents() const
Name getSelectedDelegation() const
Get the name of the selected delegation.
const time::milliseconds & getInterestLifetime() const
Interest()
Create a new Interest with an empty name (ndn:/)
const KeyLocator & getPublisherPublicKeyLocator() const
void setLink(const Block &link)
Set the link object for this interest.
represents a Link instance
Error(const std::string &what)
Interest & setExclude(const Exclude &exclude)
Interest & setChildSelector(int childSelector)
Interest & setName(const Name &name)
uint32_t getNonce() const
Get Interest's nonce.
Interest & setNonce(uint32_t nonce)
Set Interest's nonce.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
Abstraction implementing Interest selectors.
Interest & setMinSuffixComponents(int minSuffixComponents)
bool operator!=(const Interest &other) const
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
Interest & setMaxSuffixComponents(int maxSuffixComponents)
Name abstraction to represent an absolute name.
const Exclude & getExclude() const
void unsetLink()
Delete the link object for this interest.
bool hasWire() const
Check if already has wire.
Interest & setSelectors(const Selectors &selectors)
void wireDecode(const Block &wire)
Decode from the wire format.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
int getMinSuffixComponents() const
bool hasLink() const
Check whether the Interest contains a Link object.
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
bool hasSelectedDelegation() const
Check whether the Interest includes a selected delegation.
Interest & setInterestLifetime(const time::milliseconds &interestLifetime)
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
bool hasSelectors() const
const Name & getName() const