30 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<StrategyChoice>));
34 static_assert(std::is_base_of<tlv::Error, StrategyChoice::Error>::value,
35 "StrategyChoice::Error must inherit from tlv::Error");
44 template<encoding::Tag TAG>
48 size_t totalLength = 0;
53 totalLength += encoder.prependVarNumber(totalLength);
59 StrategyChoice::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>&)
const;
62 StrategyChoice::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>&)
const;
76 m_wire = buffer.block();
84 BOOST_THROW_EXCEPTION(
Error(
"expecting StrategyChoice block"));
95 BOOST_THROW_EXCEPTION(
Error(
"missing required Name field"));
100 if (val->elements().empty()) {
101 BOOST_THROW_EXCEPTION(
Error(
"expecting Strategy/Name"));
104 m_strategy.
wireDecode(*val->elements_begin());
109 BOOST_THROW_EXCEPTION(
Error(
"missing required Strategy field"));
125 m_strategy = strategy;
138 return os <<
"StrategyChoice("
139 <<
"Name: " << sc.
getName() <<
", "
Copyright (c) 2013-2016 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
a concept check for TLV abstraction with .wireEncode method
EncodingImpl< EncoderTag > EncodingBuffer
bool operator==(const StrategyChoice &a, const StrategyChoice &b)
element_container::const_iterator element_const_iterator
StrategyChoice & setStrategy(const Name &strategy)
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
void reset()
Reset wire buffer of the element.
Name abstraction to represent an absolute name.
const Name & getStrategy() const
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)
const Name & getName() const