22 #ifndef NDN_INTEREST_HPP 23 #define NDN_INTEREST_HPP 61 Interest(
const Name& name =
Name(), time::milliseconds lifetime = DEFAULT_INTEREST_LIFETIME);
72 template<encoding::Tag TAG>
95 return m_wire.hasWire();
159 return m_selectors.getMaxSuffixComponents() != 1;
186 return m_selectors.getMustBeFresh();
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;
302 return m_selectors.getMinSuffixComponents();
318 return m_selectors.getMaxSuffixComponents();
334 return m_selectors.getPublisherPublicKeyLocator();
350 return m_selectors.getExclude();
366 return m_selectors.getChildSelector();
397 time::milliseconds m_interestLifetime;
400 mutable Block m_wire;
417 return !(lhs == rhs);
422 #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)
Add or remove MustBeFresh element.
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 hasWire() const
Check if this instance has cached wire encoding.
bool hasSelectors() const
Check if Interest has any selector present.
const Block & wireEncode() const
Encode to a Block.
Represents a TLV element of NDN packet format.
Represents an Interest packet.
bool operator!=(const Data &lhs, const Data &rhs)
std::string toUri() const
Return a URI-like string that represents the Interest.
#define NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(ClassName)
int getChildSelector() const
uint32_t getNonce() const
Get nonce value.
bool getCanBePrefix() const
Check whether the CanBePrefix element is present.
const Selectors & getSelectors() 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 value.
Interest & setPublisherPublicKeyLocator(const KeyLocator &keyLocator)
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Prepend wire encoding to encoder in NDN Packet Format v0.2.
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 wire in NDN Packet Format v0.2 or v0.3.
bool matchesInterest(const Interest &other) const
Check if Interest matches other interest.
const DelegationList & getForwardingHint() const
represents a list of Delegations
bool operator==(const Data &lhs, const Data &rhs)
Interest & setForwardingHint(const DelegationList &value)
Interest & setInterestLifetime(time::milliseconds lifetime)
Set Interest's lifetime.
const KeyLocator & getPublisherPublicKeyLocator() const
const time::milliseconds DEFAULT_INTEREST_LIFETIME
default value for InterestLifetime
time::milliseconds getInterestLifetime() const
#define NDN_CXX_DEPRECATED
Mark a type, variable, or function as deprecated.
Represents a Data packet.
bool getMustBeFresh() const
Check whether the MustBeFresh element is present.
represents an error in TLV encoding or decoding
Represents Exclude selector in NDN Interest.
Interest & setCanBePrefix(bool canBePrefix)
Add or remove CanBePrefix element.
bool hasNonce() const
Check if the Nonce element is present.