represents an Interest packet More...
#include <interest.hpp>
Data Structures | |
class | Error |
Public Member Functions | |
Interest () | |
Create a new Interest with an empty name (ndn:/ ) More... | |
Interest (const Name &name) | |
Create a new Interest with the given name. More... | |
Interest (const Name &name, const time::milliseconds &interestLifetime) | |
Create a new Interest with the given name and interest lifetime. More... | |
Interest (const Block &wire) | |
Create from wire encoding. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Encode to a wire format. More... | |
void | wireDecode (const Block &wire) |
Decode from the wire format. More... | |
bool | hasWire () const |
Check if already has wire. More... | |
std::string | toUri () const |
Encode the name according to the NDN URI Scheme. More... | |
bool | hasLink () const |
Check whether the Interest contains a Link object. More... | |
const Link & | getLink () const |
Get the link object for this interest. More... | |
void | setLink (const Block &link) |
Set the link object for this interest. More... | |
void | unsetLink () |
Delete the link object for this interest. More... | |
bool | hasSelectedDelegation () const |
Check whether the Interest includes a selected delegation. More... | |
Name | getSelectedDelegation () const |
Get the name of the selected delegation. More... | |
void | setSelectedDelegation (const Name &delegationName) |
Set the selected delegation. More... | |
void | setSelectedDelegation (size_t delegationIndex) |
Set the selected delegation. More... | |
void | unsetSelectedDelegation () |
Unset the selected delegation. More... | |
bool | matchesName (const Name &name) const |
Check if Interest, including selectors, matches the given name . More... | |
bool | matchesData (const Data &data) const |
Check if Interest can be satisfied by data . More... | |
const Name & | getName () const |
Interest & | setName (const Name &name) |
const time::milliseconds & | getInterestLifetime () const |
Interest & | setInterestLifetime (const time::milliseconds &interestLifetime) |
bool | hasNonce () const |
Check if Nonce set. More... | |
uint32_t | getNonce () const |
Get Interest's nonce. More... | |
Interest & | setNonce (uint32_t nonce) |
Set Interest's nonce. More... | |
void | refreshNonce () |
Refresh nonce. More... | |
bool | hasSelectors () const |
const Selectors & | getSelectors () const |
Interest & | setSelectors (const Selectors &selectors) |
int | getMinSuffixComponents () const |
Interest & | setMinSuffixComponents (int minSuffixComponents) |
int | getMaxSuffixComponents () const |
Interest & | setMaxSuffixComponents (int maxSuffixComponents) |
const KeyLocator & | getPublisherPublicKeyLocator () const |
Interest & | setPublisherPublicKeyLocator (const KeyLocator &keyLocator) |
const Exclude & | getExclude () const |
Interest & | setExclude (const Exclude &exclude) |
int | getChildSelector () const |
Interest & | setChildSelector (int childSelector) |
int | getMustBeFresh () const |
Interest & | setMustBeFresh (bool mustBeFresh) |
bool | operator== (const Interest &other) const |
bool | operator!= (const Interest &other) const |
template<typename T > | |
shared_ptr< T > | getTag () const |
get a tag item More... | |
template<typename T > | |
void | setTag (shared_ptr< T > tag) const |
set a tag item More... | |
template<typename T > | |
void | removeTag () const |
remove tag item More... | |
represents an Interest packet
Definition at line 42 of file interest.hpp.
ndn::Interest::Interest | ( | ) |
Create a new Interest with an empty name (ndn:/
)
make_shared
. Otherwise, .shared_from_this() will throw an exception. Definition at line 36 of file interest.cpp.
ndn::Interest::Interest | ( | const Name & | name | ) |
Create a new Interest with the given name.
name | The name for the interest. |
make_shared
. Otherwise, .shared_from_this() will throw an exception. Definition at line 42 of file interest.cpp.
ndn::Interest::Interest | ( | const Name & | name, |
const time::milliseconds & | interestLifetime | ||
) |
Create a new Interest with the given name and interest lifetime.
name | The name for the interest. |
interestLifetime | The interest lifetime in time::milliseconds, or -1 for none. |
make_shared
. Otherwise, .shared_from_this() will throw an exception. Definition at line 49 of file interest.cpp.
|
explicit |
Create from wire encoding.
make_shared
. Otherwise, .shared_from_this() will throw an exception. Definition at line 56 of file interest.cpp.
|
inline |
Definition at line 356 of file interest.hpp.
|
inline |
Definition at line 342 of file interest.hpp.
|
inline |
Definition at line 229 of file interest.hpp.
const Link & ndn::Interest::getLink | ( | ) | const |
Get the link object for this interest.
Interest::Error | if there is no link object contained in the interest |
tlv::Error | if the incorporated link object is malformed |
Definition at line 370 of file interest.cpp.
|
inline |
Definition at line 314 of file interest.hpp.
|
inline |
Definition at line 300 of file interest.hpp.
|
inline |
Definition at line 370 of file interest.hpp.
|
inline |
Definition at line 215 of file interest.hpp.
uint32_t ndn::Interest::getNonce | ( | ) | const |
Get Interest's nonce.
If nonce was not set before this call, it will be automatically assigned to a random value
Definition at line 62 of file interest.cpp.
|
inline |
Definition at line 328 of file interest.hpp.
Name ndn::Interest::getSelectedDelegation | ( | ) | const |
Get the name of the selected delegation.
Error | SelectedDelegation is not set. |
Definition at line 409 of file interest.cpp.
|
inline |
Definition at line 286 of file interest.hpp.
|
inlineinherited |
get a tag item
T | type of the tag, which must be a subclass of ndn::Tag |
nullptr | if no Tag of type T is stored |
Definition at line 67 of file tag-host.hpp.
bool ndn::Interest::hasLink | ( | ) | const |
Check whether the Interest contains a Link object.
Definition at line 364 of file interest.cpp.
|
inline |
Check if Nonce set.
Definition at line 245 of file interest.hpp.
bool ndn::Interest::hasSelectedDelegation | ( | ) | const |
Check whether the Interest includes a selected delegation.
Definition at line 403 of file interest.cpp.
|
inline |
Definition at line 280 of file interest.hpp.
|
inline |
Check if already has wire.
Definition at line 107 of file interest.hpp.
bool ndn::Interest::matchesData | ( | const Data & | data | ) | const |
Check if Interest can be satisfied by data
.
This method considers Name, MinSuffixComponents, MaxSuffixComponents, PublisherPublicKeyLocator, and Exclude. This method does not consider ChildSelector and MustBeFresh.
Definition at line 132 of file interest.cpp.
bool ndn::Interest::matchesName | ( | const Name & | name | ) | const |
Check if Interest, including selectors, matches the given name
.
name | The name to be matched. If this is a Data name, it shall contain the implicit digest component |
Definition at line 105 of file interest.cpp.
|
inline |
Definition at line 391 of file interest.hpp.
|
inline |
Definition at line 385 of file interest.hpp.
void ndn::Interest::refreshNonce | ( | ) |
Refresh nonce.
It's guaranteed that new nonce value differs from the existing one.
If nonce is already set, it will be updated to a different random value. If nonce is not set, this method does nothing.
Definition at line 91 of file interest.cpp.
|
inlineinherited |
remove tag item
Definition at line 94 of file tag-host.hpp.
|
inline |
Definition at line 362 of file interest.hpp.
Definition at line 348 of file interest.hpp.
|
inline |
Definition at line 235 of file interest.hpp.
void ndn::Interest::setLink | ( | const Block & | link | ) |
Set the link object for this interest.
link | The link object that will be included in this interest (in wire format) |
Definition at line 382 of file interest.cpp.
|
inline |
Definition at line 320 of file interest.hpp.
|
inline |
Definition at line 306 of file interest.hpp.
|
inline |
Definition at line 376 of file interest.hpp.
Definition at line 221 of file interest.hpp.
Interest & ndn::Interest::setNonce | ( | uint32_t | nonce | ) |
Set Interest's nonce.
If wire format already exists, this call simply replaces nonce in the existing wire format, without resetting and recreating it.
Definition at line 76 of file interest.cpp.
|
inline |
Definition at line 334 of file interest.hpp.
void ndn::Interest::setSelectedDelegation | ( | const Name & | delegationName | ) |
Set the selected delegation.
delegationName | The name of the selected delegation |
Definition at line 418 of file interest.cpp.
void ndn::Interest::setSelectedDelegation | ( | size_t | delegationIndex | ) |
Set the selected delegation.
delegationIndex | The index of the selected delegation |
Definition at line 431 of file interest.cpp.
Definition at line 292 of file interest.hpp.
|
inlineinherited |
set a tag item
T | type of the tag, which must be a subclass of ndn::Tag |
Definition at line 80 of file tag-host.hpp.
|
inline |
Encode the name according to the NDN URI Scheme.
If there are interest selectors, this method will append "?" and add the selectors as a query string. For example, "/test/name?ndn.ChildSelector=1"
Definition at line 412 of file interest.hpp.
void ndn::Interest::unsetLink | ( | ) |
Delete the link object for this interest.
Definition at line 394 of file interest.cpp.
void ndn::Interest::unsetSelectedDelegation | ( | ) |
Unset the selected delegation.
Definition at line 441 of file interest.cpp.
void ndn::Interest::wireDecode | ( | const Block & | wire | ) |
Decode from the wire format.
Definition at line 295 of file interest.cpp.
size_t ndn::Interest::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
Definition at line 217 of file interest.cpp.
const Block & ndn::Interest::wireEncode | ( | ) | const |
Encode to a wire format.
Definition at line 277 of file interest.cpp.