8 #ifndef NDN_KEY_LOCATOR_HPP
9 #define NDN_KEY_LOCATOR_HPP
19 class Error :
public std::runtime_error
24 : std::runtime_error(what)
100 mutable Block m_wire;
115 size_t totalLength = 0;
124 throw Error(
"Unsupported KeyLocator type");
127 totalLength += block.prependVarNumber(totalLength);
144 m_wire = buffer.block();
152 throw Error(
"Unexpected TLV type during KeyLocator decoding");
172 throw Error(
"Requested Name, but KeyLocator is not of the Name type");
void wireDecode(const Block &wire)
void setName(const Name &name)
const element_container & elements() const
Get all subelements.
Class representing wire element of the NDN packet.
Error(const std::string &what)
const Name & getName() const
element_const_iterator elements_begin() const
void reset()
Reset wire buffer of the element.
A Name holds an array of Name::Component and represents an NDN name.
size_t wireEncode(EncodingImpl< T > &block) const
Fast encoding or block size estimation.
void parse() const
Parse wire buffer into subblocks.
const Block & wireEncode() const
bool hasWire() const
Check if the Block has fully encoded wire.
size_t wireEncode(EncodingImpl< T > &block) const
bool operator==(const KeyLocator &other) const
void wireDecode(const Block &wire)
bool operator!=(const KeyLocator &other) const
KeyLocator(const Name &name)
Class representing wire element of the NDN packet.
KeyLocator(const Block &wire)
Create from wire encoding.