44 template<encoding::Tag TAG>
48 size_t totalLength = 0;
59 totalLength += encoder.prependVarNumber(totalLength);
86 BOOST_THROW_EXCEPTION(Error(
"expecting FaceEventNotification block"));
93 m_kind = readNonNegativeIntegerAs<FaceEventKind>(*val);
97 BOOST_THROW_EXCEPTION(Error(
"missing required FaceEventKind field"));
105 BOOST_THROW_EXCEPTION(Error(
"missing required FaceId field"));
113 BOOST_THROW_EXCEPTION(Error(
"missing required Uri field"));
121 BOOST_THROW_EXCEPTION(Error(
"missing required LocalUri field"));
125 m_faceScope = readNonNegativeIntegerAs<FaceScope>(*val);
129 BOOST_THROW_EXCEPTION(Error(
"missing required FaceScope field"));
137 BOOST_THROW_EXCEPTION(Error(
"missing required FacePersistency field"));
141 m_linkType = readNonNegativeIntegerAs<LinkType>(*val);
145 BOOST_THROW_EXCEPTION(Error(
"missing required LinkType field"));
153 BOOST_THROW_EXCEPTION(Error(
"missing required Flags field"));
181 os <<
"FaceEvent(Kind: " << notification.
getKind() <<
",\n" 182 <<
" FaceId: " << notification.
getFaceId() <<
",\n" 183 <<
" RemoteUri: " << notification.
getRemoteUri() <<
",\n" 184 <<
" LocalUri: " << notification.
getLocalUri() <<
",\n" 185 <<
" FaceScope: " << notification.
getFaceScope() <<
",\n" 187 <<
" LinkType: " << notification.
getLinkType() <<
",\n"
const std::string & getLocalUri() 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
element_container::const_iterator element_const_iterator
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 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.
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.
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)
void reset()
Reset wire buffer of the element.
uint64_t getFlags() const
const Block & wireEncode() const
encode FaceEventNotification
void wireDecode(const Block &wire)
decode FaceEventNotification
uint64_t getFaceId() const
EncodingImpl< EncoderTag > EncodingBuffer
uint32_t type() const
Get TLV-TYPE.
LinkType getLinkType() const
EncodingImpl< EstimatorTag > EncodingEstimator