33 static_assert(std::is_base_of<tlv::Error, StrategyChoice::Error>::value,
34 "StrategyChoice::Error must inherit from tlv::Error");
45 template<encoding::Tag TAG>
49 size_t totalLength = 0;
54 totalLength += encoder.prependVarNumber(totalLength);
60 StrategyChoice::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>&)
const;
63 StrategyChoice::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>&)
const;
77 m_wire = buffer.block();
85 BOOST_THROW_EXCEPTION(
Error(
"expecting StrategyChoice block"));
96 BOOST_THROW_EXCEPTION(
Error(
"missing required Name field"));
101 if (val->elements().empty()) {
102 BOOST_THROW_EXCEPTION(
Error(
"expecting Strategy/Name"));
105 m_strategy.
wireDecode(*val->elements_begin());
110 BOOST_THROW_EXCEPTION(
Error(
"missing required Strategy field"));
126 m_strategy = strategy;
Copyright (c) 2011-2015 Regents of the University of California.
EncodingImpl< EstimatorTag > EncodingEstimator
size_t prependNestedBlock(EncodingImpl< TAG > &encoder, uint32_t type, const U &value)
Prepend a TLV block of type type with WireEncodable value as a value.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
Class representing a wire element of NDN-TLV packet format.
void wireDecode(const Block &wire)
element_const_iterator elements_end() const
element_const_iterator elements_begin() const
const Block & wireEncode() const
EncodingImpl< EncoderTag > EncodingBuffer
Copyright (c) 2011-2015 Regents of the University of California.
element_container::const_iterator element_const_iterator
StrategyChoice & setStrategy(const Name &strategy)
void reset()
Reset wire buffer of the element.
Name abstraction to represent an absolute name.
void parse() const
Parse wire buffer into subblocks.
bool hasWire() const
Check if the Block has fully encoded wire.
represents NFD StrategyChoice dataset
void wireDecode(const Block &wire)
a concept check for TLV abstraction with .wireEncode method
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
StrategyChoice & setName(const Name &name)