7 #ifndef NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
8 #define NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
10 #include "../encoding/block.hpp"
11 #include "../encoding/tlv-nfd.hpp"
56 inline const std::string&
60 setText(
const std::string& text);
95 inline const std::string&
152 throw Error(
"Requested decoding of ControlResponse, but Block is of different type");
158 throw Error(
"Incorrect ControlResponse format (StatusCode missing or not the first item)");
167 throw Error(
"Incorrect ControlResponse format (StatusText missing or not the second item)");
169 m_text.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
188 #endif // NDN_MANAGEMENT_CONTROL_RESPONSE_HPP
std::ostream & operator<<(std::ostream &os, const ControlParameters ¶meters)
Block nonNegativeIntegerBlock(uint32_t type, uint64_t value)
ControlResponse(const Block &block)
const Block & getBody() const
ControlResponse(uint32_t code, const std::string &text)
const Block & wireEncode() const
void setBody(const Block &body)
Class representing wire element of the NDN packet.
void setCode(uint32_t code)
void setText(const std::string &text)
uint64_t readNonNegativeInteger(const Block &block)
element_const_iterator elements_end() const
element_const_iterator elements_begin() const
Class defining abstraction of ControlResponse for NFD Control Protocol.
const std::string & getText() const
void wireDecode(const Block &block)
element_container::const_iterator element_const_iterator
void reset()
Reset wire buffer of the element.
void push_back(const Block &element)
void parse() const
Parse wire buffer into subblocks.
void encode()
Encode subblocks into wire buffer.
Block dataBlock(uint32_t type, const char *data, size_t dataSize)
bool hasWire() const
Check if the Block has fully encoded wire.
Error(const std::string &what)