32 m_content.emplace_back(prefix);
38 if (m_wire.hasWire()) {
42 ndn::EncodingEstimator estimator;
45 ndn::EncodingBuffer buffer(estimatedSize, 0);
48 m_wire = buffer.block();
52 template<ndn::encoding::Tag TAG>
56 size_t totalLength = 0;
58 for (std::vector<ndn::Name>::const_reverse_iterator it = m_content.rbegin();
59 it != m_content.rend(); ++it) {
60 totalLength += it->wireEncode(block);
63 totalLength += block.prependVarNumber(totalLength);
74 auto blockType = wire.type();
76 BOOST_THROW_EXCEPTION(ndn::tlv::Error(
"Expected PSyncContent Block, but Block is of type: #" +
77 ndn::to_string(blockType)));
85 for (
auto it = m_wire.elements_begin(); it != m_wire.elements_end(); ++it) {
86 if (it->type() == ndn::tlv::Name) {
87 m_content.emplace_back(*it);
90 BOOST_THROW_EXCEPTION(ndn::tlv::Error(
"Expected Name Block, but Block is of type: #" +
91 ndn::to_string(it->type())));
99 std::vector<ndn::Name> content = state.
getContent();
102 std::copy(content.begin(), content.end(), ndn::make_ostream_joiner(os,
", "));
void addContent(const ndn::Name &prefix)
std::vector< ndn::Name > getContent() const
const ndn::Block & wireEncode() const
std::ostream & operator<<(std::ostream &out, const BloomFilter &bf)
NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(State)
void wireDecode(const ndn::Block &wire)