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() <<
", "
represents NFD General Status dataset
Copyright (c) 2011-2015 Regents of the University of California.
size_t getNMeasurementsEntries() const
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)
const time::system_clock::TimePoint & getStartTimestamp() const
const std::string & getNfdVersion() const
boost::posix_time::time_duration milliseconds(long duration)
ForwarderStatus & setNInData(uint64_t nInData)
size_t getNFibEntries() const
element_container::const_iterator element_const_iterator
ForwarderStatus & setNOutData(uint64_t nOutData)
ForwarderStatus & setNInNacks(uint64_t nInNacks)
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.
uint64_t getNInNacks() const
uint64_t getNInInterests() const
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
size_t getNCsEntries() const
uint64_t getNOutNacks() const
ForwarderStatus & setNNameTreeEntries(size_t nNameTreeEntries)
ForwarderStatus & setNInInterests(uint64_t nInInterests)
ForwarderStatus & setStartTimestamp(const time::system_clock::TimePoint &startTimestamp)
Copyright (c) 2011-2015 Regents of the University of California.
uint64_t getNOutInterests() const
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)
size_t getNPitEntries() const
concept check for an item in a Status Dataset
uint64_t getNInData() const
const Block & wireEncode() const
encode ForwarderStatus as a Content block
void parse() const
Parse TLV-VALUE into sub elements.
uint32_t type() const
Get TLV-TYPE.
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.
void wireDecode(const Block &wire)
decode ForwarderStatus from a Content block
bool hasWire() const
Check if the Block has fully encoded wire.
size_t getNNameTreeEntries() const
uint64_t getNOutData() const
element_const_iterator elements_end() const
Equivalent to elements().end()
const time::system_clock::TimePoint & getCurrentTimestamp() const
element_const_iterator elements_begin() const
Equivalent to elements().begin()
ForwarderStatus & setNMeasurementsEntries(size_t nMeasurementsEntries)
ForwarderStatus & setCurrentTimestamp(const time::system_clock::TimePoint ¤tTimestamp)
EncodingImpl< EncoderTag > EncodingBuffer
EncodingImpl< EstimatorTag > EncodingEstimator