33 static_assert(std::is_base_of<tlv::Error, ForwarderStatus::Error>::value,
34 "ForwarderStatus::Error must inherit from tlv::Error");
37 : m_startTimestamp(
time::system_clock::TimePoint::min())
38 , m_currentTimestamp(
time::system_clock::TimePoint::min())
39 , m_nNameTreeEntries(0)
42 , m_nMeasurementsEntries(0)
56 template<encoding::Tag TAG>
60 size_t totalLength = 0;
73 m_nMeasurementsEntries);
85 reinterpret_cast<const uint8_t*>(m_nfdVersion.c_str()),
88 totalLength += encoder.prependVarNumber(totalLength);
94 ForwarderStatus::wireEncode<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>&)
const;
97 ForwarderStatus::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>&)
const;
111 m_wire = buffer.block();
119 BOOST_THROW_EXCEPTION(
Error(
"expecting Content block for Status payload"));
126 m_nfdVersion.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
130 BOOST_THROW_EXCEPTION(
Error(
"missing required NfdVersion field"));
138 BOOST_THROW_EXCEPTION(
Error(
"missing required StartTimestamp field"));
146 BOOST_THROW_EXCEPTION(
Error(
"missing required CurrentTimestamp field"));
154 BOOST_THROW_EXCEPTION(
Error(
"missing required NNameTreeEntries field"));
162 BOOST_THROW_EXCEPTION(
Error(
"missing required NFibEntries field"));
170 BOOST_THROW_EXCEPTION(
Error(
"missing required NPitEntries field"));
178 BOOST_THROW_EXCEPTION(
Error(
"missing required NMeasurementsEntries field"));
186 BOOST_THROW_EXCEPTION(
Error(
"missing required NCsEntries field"));
194 BOOST_THROW_EXCEPTION(
Error(
"missing required NInInterests field"));
202 BOOST_THROW_EXCEPTION(
Error(
"missing required NInDatas field"));
210 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutInterests field"));
218 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutDatas field"));
226 m_nfdVersion = nfdVersion;
234 m_startTimestamp = startTimestamp;
242 m_currentTimestamp = currentTimestamp;
250 m_nNameTreeEntries = nNameTreeEntries;
258 m_nFibEntries = nFibEntries;
266 m_nPitEntries = nPitEntries;
274 m_nMeasurementsEntries = nMeasurementsEntries;
282 m_nCsEntries = nCsEntries;
290 m_nInInterests = nInInterests;
298 m_nInDatas = nInDatas;
306 m_nOutInterests = nOutInterests;
314 m_nOutDatas = nOutDatas;
ForwarderStatus & setNOutDatas(uint64_t nOutDatas)
represents NFD Forwarder Status
Copyright (c) 2011-2015 Regents of the University of California.
ForwarderStatus & setNFibEntries(size_t nFibEntries)
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Helper to prepend TLV block type type containing non-negative integer value.
EncodingImpl< EstimatorTag > EncodingEstimator
Class representing a wire element of NDN-TLV packet format.
ForwarderStatus & setNCsEntries(size_t nCsEntries)
uint64_t readNonNegativeInteger(const Block &block)
Helper to read a non-negative integer from a block.
element_const_iterator elements_end() const
ForwarderStatus & setNNameTreeEntries(size_t nNameTreeEntries)
element_const_iterator elements_begin() const
ForwarderStatus & setNInInterests(uint64_t nInInterests)
EncodingImpl< EncoderTag > EncodingBuffer
ForwarderStatus & setStartTimestamp(const time::system_clock::TimePoint &startTimestamp)
Copyright (c) 2011-2015 Regents of the University of California.
element_container::const_iterator element_const_iterator
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
void reset()
Reset wire buffer of the element.
ForwarderStatus & setNPitEntries(size_t nPitEntries)
const Block & wireEncode() const
encode ForwarderStatus as a Content block
void parse() const
Parse wire buffer into subblocks.
system_clock::TimePoint fromUnixTimestamp(const milliseconds &duration)
Convert UNIX timestamp to system_clock::TimePoint.
milliseconds toUnixTimestamp(const system_clock::TimePoint &point)
Convert system_clock::TimePoint to UNIX timestamp.
ForwarderStatus & setNInDatas(uint64_t nInDatas)
void wireDecode(const Block &wire)
decode ForwarderStatus from a Content block
bool hasWire() const
Check if the Block has fully encoded wire.
a concept check for TLV abstraction with .wireEncode method
ForwarderStatus & setNMeasurementsEntries(size_t nMeasurementsEntries)
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint ¤tTimestamp)
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...