66 append(span<const uint8_t> bytes);
88 using DataSender = std::function<void(
const Name& dataName,
const Block& content,
bool isFinalBlock)>;
97 DataSender m_dataSender;
98 NackSender m_nackSender;
100 std::vector<uint8_t> m_buffer;
101 uint64_t m_segmentNo = 0;
108 State m_state = State::INITIAL;
Provides a context for generating the response to a StatusDataset request.
StatusDatasetContext & setPrefix(const Name &prefix)
Changes the prefix of the response Data packets.
void end()
Finalizes the response successfully after appending zero or more blocks.
void append(span< const uint8_t > bytes)
Appends a sequence of bytes to the response.
const Name & getPrefix() const
Returns the prefix of Data packets, with version component but without segment component.
void reject(const ControlResponse &resp=ControlResponse().setCode(400))
Rejects the request.