A prefix announcement object that represents an application's intent of registering a prefix toward itself. More...
#include <ndn-cxx/prefix-announcement.hpp>
Inheritance diagram for ndn::PrefixAnnouncement:
Collaboration diagram for ndn::PrefixAnnouncement:Classes | |
| class | Error |
Public Member Functions | |
| PrefixAnnouncement () | |
| Construct an empty prefix announcement. More... | |
| PrefixAnnouncement (Data data) | |
| Decode a prefix announcement from Data. More... | |
| const Name & | getAnnouncedName () const |
| Return announced name. More... | |
| const std::optional< Data > & | getData () const |
| Get the Data representing the prefix announcement, if available. More... | |
| time::milliseconds | getExpiration () const |
| Return relative expiration period. More... | |
| std::optional< security::ValidityPeriod > | getValidityPeriod () const |
| Return absolute validity period. More... | |
| PrefixAnnouncement & | setAnnouncedName (Name name) |
| Set announced name. More... | |
| PrefixAnnouncement & | setExpiration (time::milliseconds expiration) |
| Set relative expiration period. More... | |
| PrefixAnnouncement & | setValidityPeriod (std::optional< security::ValidityPeriod > validity) |
| Set absolute validity period. More... | |
| const Data & | toData (KeyChain &keyChain, const ndn::security::SigningInfo &si=security::SigningInfo(), std::optional< uint64_t > version=std::nullopt) const |
| Create a Data packet representing the prefix announcement, if it does not exist. More... | |
Static Public Member Functions | |
| static const name::Component & | getKeywordComponent () |
Returns the well-known keyword name component used for prefix announcements (32=PA) More... | |
Friends | |
| bool | operator== (const PrefixAnnouncement &lhs, const PrefixAnnouncement &rhs) |
| Test whether two prefix announcements have the same name, expiration period, and validity period. More... | |
A prefix announcement object that represents an application's intent of registering a prefix toward itself.
Definition at line 36 of file prefix-announcement.hpp.
|
default |
Construct an empty prefix announcement.
|
explicit |
Decode a prefix announcement from Data.
| tlv::Error | the Data is not a prefix announcement. |
Definition at line 29 of file prefix-announcement.cpp.
|
inline |
Return announced name.
Definition at line 82 of file prefix-announcement.hpp.
|
inline |
Get the Data representing the prefix announcement, if available.
Definition at line 62 of file prefix-announcement.hpp.
|
inline |
Return relative expiration period.
Definition at line 96 of file prefix-announcement.hpp.
|
static |
Returns the well-known keyword name component used for prefix announcements (32=PA)
Definition at line 120 of file prefix-announcement.cpp.
|
inline |
Return absolute validity period.
Definition at line 111 of file prefix-announcement.hpp.
| PrefixAnnouncement & ndn::PrefixAnnouncement::setAnnouncedName | ( | Name | name | ) |
Set announced name.
Definition at line 93 of file prefix-announcement.cpp.
| PrefixAnnouncement & ndn::PrefixAnnouncement::setExpiration | ( | time::milliseconds | expiration | ) |
Set relative expiration period.
| std::invalid_argument | expiration period is negative. |
Definition at line 101 of file prefix-announcement.cpp.
| PrefixAnnouncement & ndn::PrefixAnnouncement::setValidityPeriod | ( | std::optional< security::ValidityPeriod > | validity | ) |
Set absolute validity period.
Definition at line 112 of file prefix-announcement.cpp.
| const Data & ndn::PrefixAnnouncement::toData | ( | KeyChain & | keyChain, |
| const ndn::security::SigningInfo & | si = security::SigningInfo(), |
||
| std::optional< uint64_t > | version = std::nullopt |
||
| ) | const |
Create a Data packet representing the prefix announcement, if it does not exist.
| keyChain | KeyChain to sign the Data. |
| si | signing parameters. |
| version | version number in Data name; if nullopt, use current Unix timestamp (in milliseconds) as the version number. |
Definition at line 67 of file prefix-announcement.cpp.
|
friend |
Test whether two prefix announcements have the same name, expiration period, and validity period.
Definition at line 139 of file prefix-announcement.hpp.