#include <key-locator.hpp>
Classes | |
class | Error |
Public Member Functions | |
KeyLocator () | |
Construct an empty KeyLocator. More... | |
KeyLocator (const Name &name) | |
Construct from Name. More... | |
KeyLocator (const Block &wire) | |
Construct from wire encoding. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Prepend wire encoding to encoder . More... | |
const Block & | wireEncode () const |
void | wireDecode (const Block &wire) |
Decode from wire encoding. More... | |
NDN_CXX_NODISCARD bool | empty () const |
uint32_t | getType () const |
KeyLocator & | clear () |
Reset KeyLocator to its default-constructed state. More... | |
const Name & | getName () const |
Get nested Name element. More... | |
KeyLocator & | setName (const Name &name) |
Set nested Name element. More... | |
const Block & | getKeyDigest () const |
Get nested KeyDigest element. More... | |
KeyLocator & | setKeyDigest (const Block &keyDigest) |
Set nested KeyDigest element (whole TLV). More... | |
KeyLocator & | setKeyDigest (const ConstBufferPtr &keyDigest) |
Set nested KeyDigest element value. More... | |
Friends | |
bool | operator== (const KeyLocator &lhs, const KeyLocator &rhs) |
bool | operator!= (const KeyLocator &lhs, const KeyLocator &rhs) |
std::ostream & | operator<< (std::ostream &, const KeyLocator &) |
Definition at line 30 of file key-locator.hpp.
|
default |
Construct an empty KeyLocator.
empty() == true
ndn::KeyLocator::KeyLocator | ( | const Name & | name | ) |
Construct from Name.
Definition at line 46 of file key-locator.cpp.
|
explicit |
Construct from wire encoding.
Definition at line 41 of file key-locator.cpp.
References wireDecode().
size_t ndn::KeyLocator::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Prepend wire encoding to encoder
.
Definition at line 53 of file key-locator.cpp.
References ndn::tlv::KeyLocator, ndn::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(), NDN_THROW, ndn::encoding::prependBlock(), ndn::to_string(), and nonstd::variants::visit().
const Block & ndn::KeyLocator::wireEncode | ( | ) | const |
Definition at line 75 of file key-locator.cpp.
References ndn::Block::hasWire().
void ndn::KeyLocator::wireDecode | ( | const Block & | wire | ) |
Decode from wire encoding.
Error | outer TLV type is not KeyLocator |
Definition at line 91 of file key-locator.cpp.
References clear(), ndn::Block::elements(), ndn::Block::elements_begin(), ndn::tlv::KeyDigest, ndn::tlv::KeyLocator, ndn::tlv::Name, NDN_THROW, ndn::Block::parse(), and ndn::Block::type().
Referenced by KeyLocator().
|
inline |
Definition at line 75 of file key-locator.hpp.
References clear(), getKeyDigest(), getName(), getType(), setKeyDigest(), and setName().
uint32_t ndn::KeyLocator::getType | ( | ) | const |
Definition at line 119 of file key-locator.cpp.
References ndn::tlv::Invalid, ndn::tlv::KeyDigest, ndn::tlv::Name, and NDN_CXX_UNREACHABLE.
Referenced by empty(), and ndn::security::v2::getKeyLocatorName().
KeyLocator & ndn::KeyLocator::clear | ( | ) |
Reset KeyLocator to its default-constructed state.
empty() == true
getType() == tlv::Invalid
Definition at line 136 of file key-locator.cpp.
References ndn::Block::reset().
Referenced by empty(), and wireDecode().
const Name & ndn::KeyLocator::getName | ( | ) | const |
Get nested Name element.
Definition at line 144 of file key-locator.cpp.
References NDN_THROW.
Referenced by empty(), and ndn::security::v2::getKeyLocatorName().
KeyLocator & ndn::KeyLocator::setName | ( | const Name & | name | ) |
Set nested Name element.
Definition at line 155 of file key-locator.cpp.
References ndn::Block::reset().
Referenced by empty().
const Block & ndn::KeyLocator::getKeyDigest | ( | ) | const |
Get nested KeyDigest element.
Error | if type is not tlv::KeyDigest |
Definition at line 163 of file key-locator.cpp.
References NDN_THROW.
Referenced by empty().
KeyLocator & ndn::KeyLocator::setKeyDigest | ( | const Block & | keyDigest | ) |
Set nested KeyDigest element (whole TLV).
getType() == tlv::KeyDigest
std::invalid_argument | Block type is not tlv::KeyDigest |
Definition at line 174 of file key-locator.cpp.
References ndn::tlv::KeyDigest, NDN_THROW, ndn::Block::reset(), ndn::to_string(), and ndn::Block::type().
Referenced by empty().
KeyLocator & ndn::KeyLocator::setKeyDigest | ( | const ConstBufferPtr & | keyDigest | ) |
Set nested KeyDigest element value.
keyDigest | buffer to use as TLV-VALUE of the nested KeyDigest element. |
getType() == tlv::KeyDigest
Definition at line 185 of file key-locator.cpp.
References ndn::tlv::KeyDigest, ndn::encoding::makeBinaryBlock(), and ndn::Block::reset().
|
friend |
Definition at line 131 of file key-locator.hpp.
|
friend |
Definition at line 137 of file key-locator.hpp.
|
friend |
Definition at line 194 of file key-locator.cpp.