51 template<encoding::Tag TAG>
55 size_t totalLength = 0;
69 if (m_expirationPeriod) {
71 m_expirationPeriod->count());
77 totalLength += encoder.prependVarNumber(totalLength);
104 BOOST_THROW_EXCEPTION(Error(
"expecting FaceStatus block"));
115 BOOST_THROW_EXCEPTION(Error(
"missing required FaceId field"));
123 BOOST_THROW_EXCEPTION(Error(
"missing required Uri field"));
131 BOOST_THROW_EXCEPTION(Error(
"missing required LocalUri field"));
143 m_faceScope = readNonNegativeIntegerAs<FaceScope>(*val);
147 BOOST_THROW_EXCEPTION(Error(
"missing required FaceScope field"));
155 BOOST_THROW_EXCEPTION(Error(
"missing required FacePersistency field"));
159 m_linkType = readNonNegativeIntegerAs<LinkType>(*val);
163 BOOST_THROW_EXCEPTION(Error(
"missing required LinkType field"));
171 BOOST_THROW_EXCEPTION(Error(
"missing required NInInterests field"));
179 BOOST_THROW_EXCEPTION(Error(
"missing required NInData field"));
187 BOOST_THROW_EXCEPTION(Error(
"missing required NInNacks field"));
195 BOOST_THROW_EXCEPTION(Error(
"missing required NOutInterests field"));
203 BOOST_THROW_EXCEPTION(Error(
"missing required NOutData field"));
211 BOOST_THROW_EXCEPTION(Error(
"missing required NOutNacks field"));
219 BOOST_THROW_EXCEPTION(Error(
"missing required NInBytes field"));
227 BOOST_THROW_EXCEPTION(Error(
"missing required NOutBytes field"));
235 BOOST_THROW_EXCEPTION(Error(
"missing required Flags field"));
243 m_expirationPeriod = expirationPeriod;
259 m_nInInterests = nInInterests;
275 m_nInNacks = nInNacks;
283 m_nOutInterests = nOutInterests;
291 m_nOutData = nOutData;
299 m_nOutNacks = nOutNacks;
307 m_nInBytes = nInBytes;
315 m_nOutBytes = nOutBytes;
344 os <<
"Face(FaceId: " << status.
getFaceId() <<
",\n" 352 os <<
" ExpirationPeriod: infinite,\n";
361 <<
" Data: {in: " << status.
getNInData() <<
", " constexpr nullopt_t nullopt
uint64_t getNInNacks() const
void wireDecode(const Block &wire)
decode FaceStatus
LinkType getLinkType() const
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.
uint64_t getFlags() const
bool hasExpirationPeriod() const
FaceScope getFaceScope() const
boost::posix_time::time_duration milliseconds(long duration)
element_container::const_iterator element_const_iterator
time::milliseconds getExpirationPeriod() const
Helper class to convert a number to hexadecimal format, for use with stream insertion operators...
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.
FaceStatus & setNOutBytes(uint64_t nOutBytes)
FaceStatus & setNOutInterests(uint64_t nOutInterests)
void emplace(Args &&...args)
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
FaceStatus & setExpirationPeriod(time::milliseconds expirationPeriod)
FaceStatus & setNInInterests(uint64_t nInInterests)
FaceStatus & setNInBytes(uint64_t nInBytes)
FaceStatus & unsetExpirationPeriod()
uint64_t getNInInterests() const
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
uint64_t getNOutData() const
uint64_t getFaceId() const
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
void reset()
Reset wire buffer of the element.
const std::string & getLocalUri() const
concept check for an item in a Status Dataset
uint64_t getNOutBytes() const
void parse() const
Parse TLV-VALUE into sub elements.
const std::string & getRemoteUri() const
uint32_t type() const
Get TLV-TYPE.
uint64_t getNOutInterests() const
FacePersistency getFacePersistency() const
FaceStatus & setNOutNacks(uint64_t nOutNacks)
uint64_t getNInBytes() const
bool hasWire() const
Check if the Block has fully encoded wire.
uint64_t getNInData() const
element_const_iterator elements_end() const
Equivalent to elements().end()
FaceStatus & setNInData(uint64_t nInData)
element_const_iterator elements_begin() const
Equivalent to elements().begin()
const Block & wireEncode() const
encode FaceStatus
uint64_t getNOutNacks() const
EncodingImpl< EncoderTag > EncodingBuffer
EncodingImpl< EstimatorTag > EncodingEstimator