22 #ifndef NDN_INTEREST_HPP 23 #define NDN_INTEREST_HPP 61 Interest(
const Name& name =
Name(), time::milliseconds interestLifetime = DEFAULT_INTEREST_LIFETIME);
73 template<encoding::Tag TAG>
95 return m_wire.hasWire();
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;
250 return m_selectors.getMinSuffixComponents();
264 return m_selectors.getMaxSuffixComponents();
278 return m_selectors.getPublisherPublicKeyLocator();
292 return m_selectors.getExclude();
306 return m_selectors.getChildSelector();
320 return m_selectors.getMustBeFresh();
335 time::milliseconds m_interestLifetime;
338 mutable Block m_wire;
355 return !(lhs == rhs);
360 #endif // NDN_INTEREST_HPP
int getMinSuffixComponents() const
int getMaxSuffixComponents() const
const Name & getName() const
Copyright (c) 2013-2017 Regents of the University of California.
bool matchesName(const Name &name) const
Check if Interest, including selectors, matches the given name.
Interest & modifyForwardingHint(const Modifier &modifier)
modify ForwardingHint in-place
Interest & setMustBeFresh(bool mustBeFresh)
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.
Represents a TLV element of NDN packet format.
represents an Interest packet
bool operator!=(const Data &lhs, const Data &rhs)
std::string toUri() const
Encode the name according to the NDN URI Scheme.
#define NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
int getChildSelector() const
uint32_t getNonce() const
Get nonce.
Interest(const Name &name=Name(), time::milliseconds interestLifetime=DEFAULT_INTEREST_LIFETIME)
Create a new Interest with the given name and interest lifetime.
const Selectors & getSelectors() const
int getMustBeFresh() const
Error(const std::string &what)
Interest & setExclude(const Exclude &exclude)
Interest & setChildSelector(int childSelector)
Interest & setName(const Name &name)
Interest & setNonce(uint32_t nonce)
Set nonce.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
base class to allow simple management of packet tags
const Exclude & getExclude() const
Abstraction implementing Interest selectors.
Interest & setMinSuffixComponents(int minSuffixComponents)
Interest & setMaxSuffixComponents(int maxSuffixComponents)
Represents an absolute name.
bool matchesData(const Data &data) const
Check if Interest can be satisfied by data.
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.
const DelegationList & getForwardingHint() const
Interest & setInterestLifetime(time::milliseconds interestLifetime)
Set Interest's lifetime.
represents a list of Delegations
bool operator==(const Data &lhs, const Data &rhs)
Interest & setForwardingHint(const DelegationList &value)
const KeyLocator & getPublisherPublicKeyLocator() const
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
time::milliseconds getInterestLifetime() const
Represents a Data packet.
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
bool hasNonce() const
Check if Nonce set.