22 #ifndef NDN_INTEREST_HPP
23 #define NDN_INTEREST_HPP
75 Interest(
const Name& name,
const time::milliseconds& interestLifetime);
87 template<encoding::Tag TAG>
239 const time::milliseconds&
242 return m_interestLifetime;
248 m_interestLifetime = interestLifetime;
293 return !m_selectors.
empty();
305 m_selectors = selectors;
404 return !(*
this == other);
410 mutable Block m_nonce;
411 time::milliseconds m_interestLifetime;
413 mutable Block m_link;
414 mutable shared_ptr<Link> m_linkCached;
415 size_t m_selectedDelegationIndex;
416 mutable Block m_wire;
425 std::ostringstream os;
432 #endif // NDN_INTEREST_HPP
int getMinSuffixComponents() const
bool hasSelectedDelegation() const
Check whether the Interest includes a selected delegation.
int getMaxSuffixComponents() const
const Name & getName() const
Copyright (c) 2013-2016 Regents of the University of California.
bool operator==(const Interest &other) const
bool matchesName(const Name &name) const
Check if Interest, including selectors, matches the given name.
Interest & setMustBeFresh(bool mustBeFresh)
Selectors & setMustBeFresh(bool mustBeFresh)
void setSelectedDelegation(const Name &delegationName)
Set the selected delegation.
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 hasWire() const
Check if already has wire.
bool hasSelectors() const
const Block & wireEncode() const
Encode to a wire format.
Class representing a wire element of NDN-TLV packet format.
represents an Interest packet
std::string toUri() const
Encode the name according to the NDN URI Scheme.
const time::milliseconds & getInterestLifetime() const
int getChildSelector() const
Name getSelectedDelegation() const
Get the name of the selected delegation.
uint32_t getNonce() const
Get Interest's nonce.
const Link & getLink() const
Get the link object for this interest.
Selectors & setMaxSuffixComponents(int maxSuffixComponents)
void unsetSelectedDelegation()
Unset the selected delegation.
Selectors & setExclude(const Exclude &exclude)
const KeyLocator & getPublisherPublicKeyLocator() const
Selectors & setChildSelector(int childSelector)
Selectors & setMinSuffixComponents(int minSuffixComponents)
Interest()
Create a new Interest with an empty name (ndn:/)
const Exclude & getExclude() const
void setLink(const Block &link)
Set the link object for this interest.
const Selectors & getSelectors() const
represents a Link instance
int getMustBeFresh() const
int getChildSelector() const
Error(const std::string &what)
Interest & setExclude(const Exclude &exclude)
Interest & setChildSelector(int childSelector)
Interest & setName(const Name &name)
int getMustBeFresh() const
Interest & setNonce(uint32_t nonce)
Set Interest's nonce.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
const Exclude & getExclude() const
Abstraction implementing Interest selectors.
Interest & setMinSuffixComponents(int minSuffixComponents)
Interest & setMaxSuffixComponents(int maxSuffixComponents)
void reset()
Reset wire buffer of the element.
Name abstraction to represent an absolute name.
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
void unsetLink()
Delete the link object for this interest.
Interest & setSelectors(const Selectors &selectors)
void wireDecode(const Block &wire)
Decode from the wire format.
bool matchesInterest(const Interest &other) const
Check if Interest matches other interest.
bool hasLink() const
Check whether the Interest contains a Link object.
bool operator!=(const Interest &other) const
int getMinSuffixComponents() const
bool hasWire() const
Check if the Block has fully encoded wire.
const KeyLocator & getPublisherPublicKeyLocator() const
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
int getMaxSuffixComponents() const
Interest & setInterestLifetime(const time::milliseconds &interestLifetime)
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
Selectors & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
bool hasNonce() const
Check if Nonce set.