An Interest holds a Name and other fields for an interest. More...
#include <interest.hpp>
Public Member Functions | |
| Interest (const Name &name, Milliseconds interestLifetimeMilliseconds) | |
| Create a new Interest with the given name and interest lifetime and "none" for other values. More... | |
| Interest (const Name &name) | |
| Create a new Interest with the given name and "none" for other values. More... | |
| Interest (const Interest &interest) | |
| Interest () | |
| Create a new Interest with an empty name and "none" for all values. | |
| Interest & | operator= (const Interest &interest) |
| SignedBlob | wireEncode (WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) const |
| Encode this Interest for a particular wire format. More... | |
| void | wireDecode (const Blob &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Decode the input using a particular wire format and update this Interest. More... | |
| void | wireDecode (const uint8_t *input, size_t inputLength, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Decode the input using a particular wire format and update this Interest. More... | |
| void | wireDecode (const std::vector< uint8_t > &input, WireFormat &wireFormat=*WireFormat::getDefaultWireFormat()) |
| Decode the input using a particular wire format and update this Interest. More... | |
| std::string | toUri () const |
| Encode the name according to the "NDN URI Scheme". More... | |
| void | get (InterestLite &interestLite) const |
| Set interestLite to point to the values and name components in this interest, without copying any memory. More... | |
| void | set (const InterestLite &interestLite) |
| Clear this interest, and set the values by copying from interestLite. More... | |
| Name & | getName () |
| const Name & | getName () const |
| int | getMinSuffixComponents () const |
| int | getMaxSuffixComponents () const |
| const KeyLocator & | getKeyLocator () const |
| KeyLocator & | getKeyLocator () |
| Exclude & | getExclude () |
| const Exclude & | getExclude () const |
| int | getChildSelector () const |
| bool | getMustBeFresh () const |
| Return true if the content must be fresh. More... | |
| Milliseconds | getInterestLifetimeMilliseconds () const |
| const Blob & | getNonce () const |
| Return the nonce value from the incoming interest. More... | |
| Interest & | setName (const Name &name) |
| Set the interest name. More... | |
| Interest & | setMinSuffixComponents (int minSuffixComponents) |
| Set the min suffix components count. More... | |
| Interest & | setMaxSuffixComponents (int maxSuffixComponents) |
| Set the max suffix components count. More... | |
| Interest & | setChildSelector (int childSelector) |
| Set the child selector. More... | |
| Interest & | setMustBeFresh (bool mustBeFresh) |
| Set the MustBeFresh flag. More... | |
| Interest & | setInterestLifetimeMilliseconds (Milliseconds interestLifetimeMilliseconds) |
| Set the interest lifetime. More... | |
| Interest &DEPRECATED_IN_NDN_CPP | setNonce (const Blob &nonce) |
| Interest & | setKeyLocator (const KeyLocator &keyLocator) |
| Set this interest to use a copy of the given KeyLocator object. More... | |
| Interest & | setExclude (const Exclude &exclude) |
| Set this interest to use a copy of the given Exclude object. More... | |
| bool | matchesName (const Name &name) const |
| Check if this Interest's name matches the given name (using Name::match) and the given name also conforms to the interest selectors. More... | |
| const SignedBlob & | getDefaultWireEncoding () const |
| Return a reference to the defaultWireEncoding, which was encoded with getDefaultWireEncodingFormat(). More... | |
| WireFormat * | getDefaultWireEncodingFormat () const |
| Get the WireFormat which is used by getDefaultWireEncoding(). More... | |
| uint64_t | getChangeCount () const |
| Get the change count, which is incremented each time this object (or a child object) is changed. More... | |
|
inline |
Create a new Interest with the given name and interest lifetime and "none" for other values.
| name | The name for the interest. |
| interestLifetimeMilliseconds | The interest lifetime in milliseconds, or -1 for none. |
|
inline |
Create a new Interest with the given name and "none" for other values.
| name | The name for the interest. |
| void ndn::Interest::get | ( | InterestLite & | interestLite | ) | const |
Set interestLite to point to the values and name components in this interest, without copying any memory.
WARNING: The resulting pointers in interestLite are invalid after a further use of this object which could reallocate memory.
| interestLite | A InterestLite where the name components array is already allocated. |
|
inline |
Get the change count, which is incremented each time this object (or a child object) is changed.
|
inline |
Return a reference to the defaultWireEncoding, which was encoded with getDefaultWireEncodingFormat().
The SignedBlob may have a null pointer.
|
inline |
Get the WireFormat which is used by getDefaultWireEncoding().
|
inline |
Return true if the content must be fresh.
The default is true.
|
inline |
Return the nonce value from the incoming interest.
If you change any of the fields in this Interest object, then the nonce value is cleared.
| bool ndn::Interest::matchesName | ( | const Name & | name | ) | const |
Check if this Interest's name matches the given name (using Name::match) and the given name also conforms to the interest selectors.
| name | The name to check. |
| void ndn::Interest::set | ( | const InterestLite & | interestLite | ) |
Clear this interest, and set the values by copying from interestLite.
| interestLite | An InterestLite object. |
|
inline |
Set the child selector.
| childSelector | The child selector. If not specified, set to -1. |
Set this interest to use a copy of the given Exclude object.
| exclude | The Exclude object. This makes a copy of the object. If no exclude is specified, set to a new default Exclude(), or to an Exclude with size() 0. |
|
inline |
Set the interest lifetime.
| interestLifetimeMilliseconds | The interest lifetime in milliseconds. If not specified, set to -1. |
|
inline |
Set this interest to use a copy of the given KeyLocator object.
| keyLocator | The KeyLocator object. This makes a copy of the object. If no key locator is specified, set to a new default KeyLocator(), or to a KeyLocator with an unspecified type. |
|
inline |
Set the max suffix components count.
| maxSuffixComponents | The max suffix components count. If not specified, set to -1. |
|
inline |
Set the min suffix components count.
| minSuffixComponents | The min suffix components count. If not specified, set to -1. |
|
inline |
Set the MustBeFresh flag.
| mustBeFresh | True if the content must be fresh, otherwise false. If you do not set this flag, the default value is true. |
Set the interest name.
| name | The interest name. This makes a copy of the name. |
| string ndn::Interest::toUri | ( | ) | const |
Encode the name according to the "NDN URI Scheme".
If there are interest selectors, append "?" and add the selectors as a query string. For example "/test/name?ndn.ChildSelector=1".
| void ndn::Interest::wireDecode | ( | const Blob & | input, |
| WireFormat & | wireFormat = *WireFormat::getDefaultWireFormat() |
||
| ) |
Decode the input using a particular wire format and update this Interest.
If wireFormat is the default wire format, also set the defaultWireEncoding to another pointer to the input Blob.
| input | The input byte array to be decoded as an immutable Blob. |
| wireFormat | (optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat(). |
| void ndn::Interest::wireDecode | ( | const uint8_t * | input, |
| size_t | inputLength, | ||
| WireFormat & | wireFormat = *WireFormat::getDefaultWireFormat() |
||
| ) |
Decode the input using a particular wire format and update this Interest.
If wireFormat is the default wire format, also set the defaultWireEncoding field to a copy of the input. (To not copy the input, see wireDecode(Blob).)
| input | The input byte array to be decoded. |
| inputLength | The length of input. |
| wireFormat | (optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat(). |
|
inline |
Decode the input using a particular wire format and update this Interest.
If wireFormat is the default wire format, also set the defaultWireEncoding field to a copy of the input. (To not copy the input, see wireDecode(Blob).)
| input | The input byte array to be decoded. |
| wireFormat | (optional) A WireFormat object used to decode the input. If omitted, use WireFormat::getDefaultWireFormat(). |
| SignedBlob ndn::Interest::wireEncode | ( | WireFormat & | wireFormat = *WireFormat::getDefaultWireFormat() | ) | const |
Encode this Interest for a particular wire format.
If wireFormat is the default wire format, also set the defaultWireEncoding field to the encoded result. Even though this is const, if wireFormat is the default wire format we update the defaultWireEncoding.
| wireFormat | (optional) A WireFormat object used to encode this Interest. If omitted, use WireFormat::getDefaultWireFormat(). |
1.8.9.1