23 #include "../encoding/block-helpers.hpp" 24 #include "../encoding/tlv-nfd.hpp" 32 static_assert(std::is_base_of<tlv::Error, ControlResponse::Error>::value,
33 "ControlResponse::Error must inherit from tlv::Error");
80 BOOST_THROW_EXCEPTION(
Error(
"missing StatusCode sub-element"));
82 m_code = readNonNegativeIntegerAs<uint32_t>(*val);
86 BOOST_THROW_EXCEPTION(
Error(
"missing StatusText sub-element"));
Copyright (c) 2013-2017 Regents of the University of California.
element_container::const_iterator element_const_iterator
Represents a TLV element of NDN packet format.
std::string readString(const Block &block)
Read TLV-VALUE of a TLV element as a string.
const Block & wireEncode() const
Block makeNonNegativeIntegerBlock(uint32_t type, uint64_t value)
Create a TLV block containing a non-negative integer.
const std::string & getText() const
Block makeStringBlock(uint32_t type, const std::string &value)
Create a TLV block containing a string.
void push_back(const Block &element)
Append a sub element.
std::ostream & operator<<(std::ostream &os, const ControlResponse &response)
void parse() const
Parse TLV-VALUE into sub elements.
uint32_t type() const
Get TLV-TYPE.
void wireDecode(const Block &block)
void encode()
Encode sub elements into TLV-VALUE.
bool hasWire() const
Check if the Block has fully encoded wire.
std::string to_string(const V &v)
element_const_iterator elements_end() const
Equivalent to elements().end()
element_const_iterator elements_begin() const
Equivalent to elements().begin()
BOOST_CONCEPT_ASSERT((WireEncodable< ControlResponse >))