44 template<encoding::Tag TAG>
48 size_t totalLength = 0;
59 totalLength += encoder.prependVarNumber(totalLength);
94 m_kind = readNonNegativeIntegerAs<FaceEventKind>(*val);
98 NDN_THROW(Error(
"missing required FaceEventKind field"));
106 NDN_THROW(Error(
"missing required FaceId field"));
114 NDN_THROW(Error(
"missing required Uri field"));
122 NDN_THROW(Error(
"missing required LocalUri field"));
126 m_faceScope = readNonNegativeIntegerAs<FaceScope>(*val);
130 NDN_THROW(Error(
"missing required FaceScope field"));
138 NDN_THROW(Error(
"missing required FacePersistency field"));
142 m_linkType = readNonNegativeIntegerAs<LinkType>(*val);
146 NDN_THROW(Error(
"missing required LinkType field"));
154 NDN_THROW(Error(
"missing required Flags field"));
182 os <<
"FaceEvent(Kind: " << notification.
getKind() <<
",\n" 183 <<
" FaceId: " << notification.
getFaceId() <<
",\n" 184 <<
" RemoteUri: " << notification.
getRemoteUri() <<
",\n" 185 <<
" LocalUri: " << notification.
getLocalUri() <<
",\n" 186 <<
" FaceScope: " << notification.
getFaceScope() <<
",\n" 188 <<
" LinkType: " << notification.
getLinkType() <<
",\n" const std::string & getLocalUri() 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.
FacePersistency getFacePersistency() const
Helper class to convert a number to hexadecimal format, for use with stream insertion operators...
void parse() const
Parse TLV-VALUE into sub-elements.
represents a Face status change notification
FacePersistency m_facePersistency
NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(ChannelStatus)
Represents a TLV element of the NDN packet format.
size_t prependStringBlock(EncodingImpl< TAG > &encoder, uint32_t type, const std::string &value)
Prepend a TLV element containing a string.
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
std::string readString(const Block &block)
Read TLV-VALUE of a TLV element as a string.
FaceEventNotification & setKind(FaceEventKind kind)
FaceScope getFaceScope() const
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.
const std::string & getRemoteUri() const
element_const_iterator elements_end() const
Equivalent to elements().end()
Copyright (c) 2011-2015 Regents of the University of California.
void reset() noexcept
Reset the Block to a default-constructed state.
concept check for an item in a Notification Stream
bool operator==(const ChannelStatus &a, const ChannelStatus &b)
FaceEventKind getKind() const
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
uint32_t type() const noexcept
Return the TLV-TYPE of the Block.
uint64_t getFlags() const
const Block & wireEncode() const
encode FaceEventNotification
void wireDecode(const Block &wire)
decode FaceEventNotification
uint64_t getFaceId() const
EncodingImpl< EncoderTag > EncodingBuffer
LinkType getLinkType() const
EncodingImpl< EstimatorTag > EncodingEstimator