51 template<encoding::Tag TAG>
55 size_t totalLength = 0;
69 if (m_defaultCongestionThreshold) {
71 *m_defaultCongestionThreshold);
73 if (m_baseCongestionMarkingInterval) {
75 m_baseCongestionMarkingInterval->count());
80 if (m_expirationPeriod) {
82 m_expirationPeriod->count());
88 totalLength += encoder.prependVarNumber(totalLength);
115 BOOST_THROW_EXCEPTION(Error(
"expecting FaceStatus block"));
126 BOOST_THROW_EXCEPTION(Error(
"missing required FaceId field"));
134 BOOST_THROW_EXCEPTION(Error(
"missing required Uri field"));
142 BOOST_THROW_EXCEPTION(Error(
"missing required LocalUri field"));
154 m_faceScope = readNonNegativeIntegerAs<FaceScope>(*val);
158 BOOST_THROW_EXCEPTION(Error(
"missing required FaceScope field"));
166 BOOST_THROW_EXCEPTION(Error(
"missing required FacePersistency field"));
170 m_linkType = readNonNegativeIntegerAs<LinkType>(*val);
174 BOOST_THROW_EXCEPTION(Error(
"missing required LinkType field"));
182 m_baseCongestionMarkingInterval =
nullopt;
190 m_defaultCongestionThreshold =
nullopt;
206 BOOST_THROW_EXCEPTION(Error(
"missing required NInInterests field"));
214 BOOST_THROW_EXCEPTION(Error(
"missing required NInData field"));
222 BOOST_THROW_EXCEPTION(Error(
"missing required NInNacks field"));
230 BOOST_THROW_EXCEPTION(Error(
"missing required NOutInterests field"));
238 BOOST_THROW_EXCEPTION(Error(
"missing required NOutData field"));
246 BOOST_THROW_EXCEPTION(Error(
"missing required NOutNacks field"));
254 BOOST_THROW_EXCEPTION(Error(
"missing required NInBytes field"));
262 BOOST_THROW_EXCEPTION(Error(
"missing required NOutBytes field"));
270 BOOST_THROW_EXCEPTION(Error(
"missing required Flags field"));
278 m_expirationPeriod = expirationPeriod;
294 m_baseCongestionMarkingInterval = interval;
302 m_baseCongestionMarkingInterval =
nullopt;
310 m_defaultCongestionThreshold = threshold;
318 m_defaultCongestionThreshold =
nullopt;
342 m_nInInterests = nInInterests;
358 m_nInNacks = nInNacks;
366 m_nOutInterests = nOutInterests;
374 m_nOutData = nOutData;
382 m_nOutNacks = nOutNacks;
390 m_nInBytes = nInBytes;
398 m_nOutBytes = nOutBytes;
435 os <<
"Face(FaceId: " << status.
getFaceId() <<
",\n" 443 os <<
" ExpirationPeriod: infinite,\n";
459 os <<
" Mtu: " << status.
getMtu() <<
" bytes,\n";
465 <<
" Data: {in: " << status.
getNInData() <<
", " const std::string & getLocalUri() const
void wireDecode(const Block &wire)
decode FaceStatus
uint64_t getNOutInterests() const
time::milliseconds getExpirationPeriod() const
bool hasWire() const
Check if the Block has fully encoded wire.
Copyright (c) 2011-2015 Regents of the University of California.
size_t prependNonNegativeIntegerBlock(EncodingImpl< TAG > &encoder, uint32_t type, uint64_t value)
Prepend a TLV element containing a non-negative integer.
FacePersistency getFacePersistency() const
bool hasExpirationPeriod() const
uint64_t getNOutNacks() const
bool hasBaseCongestionMarkingInterval() const
element_container::const_iterator element_const_iterator
uint64_t getNOutBytes() const
uint64_t getNInInterests() const
Helper class to convert a number to hexadecimal format, for use with stream insertion operators.
FaceStatus & unsetDefaultCongestionThreshold()
void parse() const
Parse TLV-VALUE into sub elements.
FacePersistency m_facePersistency
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.
FaceScope getFaceScope() const
element_const_iterator elements_begin() const
Equivalent to elements().begin()
FaceStatus & setNOutBytes(uint64_t nOutBytes)
FaceStatus & setNOutInterests(uint64_t nOutInterests)
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
const std::string & getRemoteUri() const
uint64_t getNOutData() const
FaceStatus & setExpirationPeriod(time::milliseconds expirationPeriod)
FaceStatus & setNInInterests(uint64_t nInInterests)
uint64_t getNInBytes() const
FaceStatus & setNInBytes(uint64_t nInBytes)
FaceStatus & unsetBaseCongestionMarkingInterval()
element_const_iterator elements_end() const
Equivalent to elements().end()
FaceStatus & unsetExpirationPeriod()
FaceStatus & setNInNacks(uint64_t nInNacks)
Copyright (c) 2011-2015 Regents of the University of California.
FaceStatus & setNOutData(uint64_t nOutData)
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
represents an item in NFD Face dataset
time::nanoseconds getBaseCongestionMarkingInterval() const
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
FaceStatus & setMtu(uint64_t mtu)
set MTU (measured in bytes)
void reset()
Reset wire buffer of the element.
uint64_t getDefaultCongestionThreshold() const
get default congestion threshold (measured in bytes)
concept check for an item in a Status Dataset
FaceStatus & setBaseCongestionMarkingInterval(time::nanoseconds interval)
uint64_t getFlags() const
uint64_t getNInData() const
FaceStatus & setNOutNacks(uint64_t nOutNacks)
uint64_t getMtu() const
get MTU (measured in bytes)
const Block & wireEncode() const
encode FaceStatus
FaceStatus & setNInData(uint64_t nInData)
uint64_t getFaceId() const
bool hasDefaultCongestionThreshold() const
EncodingImpl< EncoderTag > EncodingBuffer
const nullopt_t nullopt((nullopt_t::init()))
uint32_t type() const
Get TLV-TYPE.
LinkType getLinkType() const
EncodingImpl< EstimatorTag > EncodingEstimator
FaceStatus & setDefaultCongestionThreshold(uint64_t threshold)
set default congestion threshold (measured in bytes)
uint64_t getNInNacks() const