34 : m_nNameTreeEntries(0)
37 , m_nMeasurementsEntries(0)
53 template<encoding::Tag TAG>
57 size_t totalLength = 0;
76 totalLength += encoder.prependVarNumber(totalLength);
95 m_wire = buffer.block();
103 BOOST_THROW_EXCEPTION(
Error(
"expecting Content block for Status payload"));
114 BOOST_THROW_EXCEPTION(
Error(
"missing required NfdVersion field"));
122 BOOST_THROW_EXCEPTION(
Error(
"missing required StartTimestamp field"));
130 BOOST_THROW_EXCEPTION(
Error(
"missing required CurrentTimestamp field"));
134 m_nNameTreeEntries = readNonNegativeIntegerAs<size_t>(*val);
138 BOOST_THROW_EXCEPTION(
Error(
"missing required NNameTreeEntries field"));
142 m_nFibEntries = readNonNegativeIntegerAs<size_t>(*val);
146 BOOST_THROW_EXCEPTION(
Error(
"missing required NFibEntries field"));
150 m_nPitEntries = readNonNegativeIntegerAs<size_t>(*val);
154 BOOST_THROW_EXCEPTION(
Error(
"missing required NPitEntries field"));
158 m_nMeasurementsEntries = readNonNegativeIntegerAs<size_t>(*val);
162 BOOST_THROW_EXCEPTION(
Error(
"missing required NMeasurementsEntries field"));
166 m_nCsEntries = readNonNegativeIntegerAs<size_t>(*val);
170 BOOST_THROW_EXCEPTION(
Error(
"missing required NCsEntries field"));
178 BOOST_THROW_EXCEPTION(
Error(
"missing required NInInterests field"));
186 BOOST_THROW_EXCEPTION(
Error(
"missing required NInData field"));
194 BOOST_THROW_EXCEPTION(
Error(
"missing required NInNacks field"));
202 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutInterests field"));
210 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutData field"));
218 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutNacks 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;
306 m_nInNacks = nInNacks;
314 m_nOutInterests = nOutInterests;
322 m_nOutData = nOutData;
330 m_nOutNacks = nOutNacks;
356 os <<
"GeneralStatus(NfdVersion: " << status.
getNfdVersion() <<
",\n" 366 <<
" Data: {in: " << status.
getNInData() <<
", "
uint64_t getNInInterests() const
uint64_t getNOutInterests() const
size_t getNFibEntries() const
bool hasWire() const
Check if the Block has fully encoded wire.
represents NFD General Status dataset
Copyright (c) 2011-2015 Regents of the University of California.
system_clock::TimePoint fromUnixTimestamp(milliseconds duration)
Convert UNIX timestamp to system_clock::TimePoint.
ForwarderStatus & setNFibEntries(size_t nFibEntries)
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Prepend a TLV element containing a non-negative integer.
ForwarderStatus & setNOutNacks(uint64_t nOutNacks)
uint64_t getNInData() const
ForwarderStatus & setNInData(uint64_t nInData)
element_container::const_iterator element_const_iterator
ForwarderStatus & setNOutData(uint64_t nOutData)
ForwarderStatus & setNInNacks(uint64_t nInNacks)
void parse() const
Parse TLV-VALUE into sub elements.
NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ChannelStatus)
Represents a TLV element of NDN packet format.
size_t prependStringBlock(EncodingImpl< TAG > &encoder, uint32_t type, const std::string &value)
Prepend a TLV element containing a string.
ForwarderStatus & setNCsEntries(size_t nCsEntries)
std::string readString(const Block &block)
Read TLV-VALUE of a TLV element as a string.
element_const_iterator elements_begin() const
Equivalent to elements().begin()
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
ForwarderStatus & setNNameTreeEntries(size_t nNameTreeEntries)
uint64_t getNInNacks() const
size_t getNPitEntries() const
const time::system_clock::TimePoint & getStartTimestamp() const
ForwarderStatus & setNInInterests(uint64_t nInInterests)
element_const_iterator elements_end() const
Equivalent to elements().end()
ForwarderStatus & setStartTimestamp(const time::system_clock::TimePoint &startTimestamp)
Copyright (c) 2011-2015 Regents of the University of California.
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
void reset()
Reset wire buffer of the element.
ForwarderStatus & setNPitEntries(size_t nPitEntries)
concept check for an item in a Status Dataset
milliseconds toUnixTimestamp(const system_clock::TimePoint &point)
Convert system_clock::TimePoint to UNIX timestamp.
void wireDecode(const Block &wire)
decode ForwarderStatus from a Content block
size_t getNCsEntries() const
const time::system_clock::TimePoint & getCurrentTimestamp() const
size_t getNMeasurementsEntries() const
uint64_t getNOutData() const
ForwarderStatus & setNMeasurementsEntries(size_t nMeasurementsEntries)
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint ¤tTimestamp)
size_t getNNameTreeEntries() const
const std::string & getNfdVersion() const
EncodingImpl< EncoderTag > EncodingBuffer
uint32_t type() const
Get TLV-TYPE.
EncodingImpl< EstimatorTag > EncodingEstimator
uint64_t getNOutNacks() const
const Block & wireEncode() const
encode ForwarderStatus as a Content block