34 : m_nNameTreeEntries(0)
37 , m_nMeasurementsEntries(0)
45 , m_nSatisfiedInterests(0)
46 , m_nUnsatisfiedInterests(0)
55 template<encoding::Tag TAG>
59 size_t totalLength = 0;
80 totalLength += encoder.prependVarNumber(totalLength);
99 m_wire = buffer.block();
107 BOOST_THROW_EXCEPTION(
Error(
"expecting Content block for Status payload"));
118 BOOST_THROW_EXCEPTION(
Error(
"missing required NfdVersion field"));
126 BOOST_THROW_EXCEPTION(
Error(
"missing required StartTimestamp field"));
134 BOOST_THROW_EXCEPTION(
Error(
"missing required CurrentTimestamp field"));
142 BOOST_THROW_EXCEPTION(
Error(
"missing required NNameTreeEntries field"));
150 BOOST_THROW_EXCEPTION(
Error(
"missing required NFibEntries field"));
158 BOOST_THROW_EXCEPTION(
Error(
"missing required NPitEntries field"));
166 BOOST_THROW_EXCEPTION(
Error(
"missing required NMeasurementsEntries field"));
174 BOOST_THROW_EXCEPTION(
Error(
"missing required NCsEntries field"));
182 BOOST_THROW_EXCEPTION(
Error(
"missing required NInInterests field"));
190 BOOST_THROW_EXCEPTION(
Error(
"missing required NInData field"));
198 BOOST_THROW_EXCEPTION(
Error(
"missing required NInNacks field"));
206 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutInterests field"));
214 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutData field"));
222 BOOST_THROW_EXCEPTION(
Error(
"missing required NOutNacks field"));
230 BOOST_THROW_EXCEPTION(
Error(
"missing required NSatisfiedInterests field"));
238 BOOST_THROW_EXCEPTION(
Error(
"missing required NUnsatisfiedInterests field"));
246 m_nfdVersion = nfdVersion;
254 m_startTimestamp = startTimestamp;
262 m_currentTimestamp = currentTimestamp;
270 m_nNameTreeEntries = nNameTreeEntries;
278 m_nFibEntries = nFibEntries;
286 m_nPitEntries = nPitEntries;
294 m_nMeasurementsEntries = nMeasurementsEntries;
302 m_nCsEntries = nCsEntries;
310 m_nInInterests = nInInterests;
326 m_nInNacks = nInNacks;
334 m_nOutInterests = nOutInterests;
342 m_nOutData = nOutData;
350 m_nOutNacks = nOutNacks;
358 m_nSatisfiedInterests = nSatisfiedInterests;
366 m_nUnsatisfiedInterests = nUnsatisfiedInterests;
394 os <<
"GeneralStatus(NfdVersion: " << status.
getNfdVersion() <<
",\n" 404 <<
" Data: {in: " << status.
getNInData() <<
", "
ForwarderStatus & setNFibEntries(uint64_t nFibEntries)
uint64_t getNInInterests() const
uint64_t getNOutInterests() 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.
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 getNUnsatisfiedInterests() const
uint64_t getNInData() const
uint64_t getNFibEntries() 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.
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 & setNSatisfiedInterests(uint64_t nSatisfiedInterests)
uint64_t getNInNacks() 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)
uint64_t getNMeasurementsEntries() const
ForwarderStatus & setNfdVersion(const std::string &nfdVersion)
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
ForwarderStatus & setNOutInterests(uint64_t nOutInterests)
ForwarderStatus & setNUnsatisfiedInterests(uint64_t nUnsatisfiedInterests)
void reset()
Reset wire buffer of the element.
ForwarderStatus & setNMeasurementsEntries(uint64_t nMeasurementsEntries)
concept check for an item in a Status Dataset
uint64_t getNNameTreeEntries() const
uint64_t getNSatisfiedInterests() const
milliseconds toUnixTimestamp(const system_clock::TimePoint &point)
Convert system_clock::TimePoint to UNIX timestamp.
ForwarderStatus & setNPitEntries(uint64_t nPitEntries)
ForwarderStatus & setNCsEntries(uint64_t nCsEntries)
void wireDecode(const Block &wire)
decode ForwarderStatus from a Content block
const time::system_clock::TimePoint & getCurrentTimestamp() const
uint64_t getNOutData() const
ForwarderStatus & setNNameTreeEntries(uint64_t nNameTreeEntries)
uint64_t getNCsEntries() const
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint ¤tTimestamp)
const std::string & getNfdVersion() const
EncodingImpl< EncoderTag > EncodingBuffer
uint32_t type() const
Get TLV-TYPE.
EncodingImpl< EstimatorTag > EncodingEstimator
uint64_t getNOutNacks() const
uint64_t getNPitEntries() const
const Block & wireEncode() const
encode ForwarderStatus as a Content block