|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
31 BOOST_CONCEPT_ASSERT((boost::EqualityComparable<AdditionalDescription>));
35 static_assert(std::is_base_of<tlv::Error, AdditionalDescription::Error>::value,
36 "AdditionalDescription::Error must inherit from tlv::Error");
49 auto it = m_info.find(key);
50 if (it == m_info.end())
65 return (m_info.find(key) != m_info.end());
71 return m_info.begin();
83 return m_info.begin();
92 template<encoding::Tag TAG>
96 size_t totalLength = 0;
98 for (
auto it = m_info.rbegin(); it != m_info.rend(); it++) {
99 size_t entryLength = 0;
102 entryLength += encoder.prependVarNumber(entryLength);
105 totalLength += entryLength;
108 totalLength += encoder.prependVarNumber(totalLength);
127 m_wire = buffer.block();
137 NDN_THROW(
Error(
"The supplied block does not contain wire format"));
148 const Block& entry = *it;
159 NDN_THROW(
Error(
"Invalid DescriptionKey or DescriptionValue field"));
172 for (
const auto& entry : desc) {
173 join =
"(" + entry.first +
":" + entry.second +
")";
const element_container & elements() const
Get container of sub-elements.
const std::string & get(const std::string &key) const
void set(const std::string &key, const std::string &value)
const Block & wireEncode() const
Encode ValidityPeriod into TLV block.
element_const_iterator elements_begin() const
Equivalent to elements().begin()
static const size_t KEY_OFFSET
std::string readString(const Block &block)
Read TLV-VALUE of a TLV element as a string.
ostream_joiner< std::decay_t< DelimT >, CharT, Traits > make_ostream_joiner(std::basic_ostream< CharT, Traits > &os, DelimT &&delimiter)
a concept check for TLV abstraction with .wireDecode method and constructible from Block
EncodingImpl< EstimatorTag > EncodingEstimator
uint32_t type() const
Return the TLV-TYPE of the Block.
AdditionalDescription()=default
Create an empty AdditionalDescription.
a concept check for TLV abstraction with .wireEncode method
Backport of ostream_joiner from the Library Fundamentals v2 TS.
bool has(const std::string &key) const
void wireDecode(const Block &wire)
Decode ValidityPeriod from TLV block.
std::ostream & operator<<(std::ostream &os, const AdditionalDescription &desc)
std::map< std::string, std::string >::iterator iterator
void parse() const
Parse TLV-VALUE into sub-elements.
std::map< std::string, std::string >::const_iterator const_iterator
NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(AdditionalDescription)
static const size_t VALUE_OFFSET
Represents a TLV element of NDN packet format.
size_t elements_size() const
Equivalent to elements().size()
element_const_iterator elements_end() const
Equivalent to elements().end()
Abstraction of AdditionalDescription.
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
size_t prependStringBlock(EncodingImpl< TAG > &encoder, uint32_t type, const std::string &value)
Prepend a TLV element containing a string.
a concept check for TLV abstraction with .wireEncode method
Copyright (c) 2011-2015 Regents of the University of California.
EncodingImpl< EncoderTag > EncodingBuffer