40 template<encoding::Tag TAG>
44 size_t totalLength = 0;
49 totalLength += encoder.prependVarNumber(totalLength);
68 m_wire = buffer.block();
76 BOOST_THROW_EXCEPTION(
Error(
"expecting StrategyChoice block"));
87 BOOST_THROW_EXCEPTION(
Error(
"missing required Name field"));
92 if (val->elements().empty()) {
93 BOOST_THROW_EXCEPTION(
Error(
"expecting Strategy/Name"));
101 BOOST_THROW_EXCEPTION(
Error(
"missing required Strategy field"));
117 m_strategy = strategy;
130 return os <<
"StrategyChoice(" 131 <<
"Name: " << sc.
getName() <<
", "
Copyright (c) 2011-2015 Regents of the University of California.
element_container::const_iterator element_const_iterator
size_t prependNestedBlock(EncodingImpl< TAG > &encoder, uint32_t type, const U &value)
Prepend a TLV element containing a nested TLV element.
size_t wireEncode(EncodingImpl< TAG > &encoder) const
Fast encoding or block size estimation.
NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ChannelStatus)
Represents a TLV element of NDN packet format.
void wireDecode(const Block &wire)
const Block & wireEncode() const
Copyright (c) 2011-2015 Regents of the University of California.
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
StrategyChoice & setStrategy(const Name &strategy)
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
void reset()
Reset wire buffer of the element.
Represents an absolute name.
const Name & getStrategy() const
concept check for an item in a Status Dataset
void parse() const
Parse TLV-VALUE into sub elements.
uint32_t type() const
Get TLV-TYPE.
bool hasWire() const
Check if the Block has fully encoded wire.
element_const_iterator elements_end() const
Equivalent to elements().end()
represents an item in NFD StrategyChoice dataset
element_const_iterator elements_begin() const
Equivalent to elements().begin()
void wireDecode(const Block &wire)
Decode name from wire encoding.
StrategyChoice & setName(const Name &name)
EncodingImpl< EncoderTag > EncodingBuffer
const Name & getName() const
EncodingImpl< EstimatorTag > EncodingEstimator