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"
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
FaceScope getFaceScope() const
element_container::const_iterator element_const_iterator
Helper class to convert a number to hexadecimal format, for use with stream insertion operators...
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)
uint64_t readNonNegativeInteger(const Block &block)
Read a non-negative integer from a TLV element.
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)
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
void parse() const
Parse TLV-VALUE into sub elements.
const std::string & getRemoteUri() const
uint32_t type() const
Get TLV-TYPE.
FacePersistency getFacePersistency() const
FaceEventKind getKind() const
bool hasWire() const
Check if the Block has fully encoded wire.
void wireDecode(const Block &wire)
decode FaceEventNotification
element_const_iterator elements_end() const
Equivalent to elements().end()
const Block & wireEncode() const
encode FaceEventNotification
element_const_iterator elements_begin() const
Equivalent to elements().begin()
EncodingImpl< EncoderTag > EncodingBuffer
EncodingImpl< EstimatorTag > EncodingEstimator