33 static_assert(std::is_base_of<tlv::Error, FaceEventNotification::Error>::value,
34 "FaceEventNotification::Error must inherit from tlv::Error");
46 template<encoding::Tag TAG>
50 size_t totalLength = 0;
67 totalLength += encoder.prependVarNumber(totalLength);
84 m_wire = buffer.block();
92 BOOST_THROW_EXCEPTION(Error(
"expecting FaceEventNotification block"));
103 BOOST_THROW_EXCEPTION(Error(
"missing required FaceEventKind field"));
111 BOOST_THROW_EXCEPTION(Error(
"missing required FaceId field"));
115 m_remoteUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
119 BOOST_THROW_EXCEPTION(Error(
"missing required Uri field"));
123 m_localUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
127 BOOST_THROW_EXCEPTION(Error(
"missing required LocalUri field"));
135 BOOST_THROW_EXCEPTION(Error(
"missing required FaceScope field"));
143 BOOST_THROW_EXCEPTION(Error(
"missing required FacePersistency field"));
151 BOOST_THROW_EXCEPTION(Error(
"missing required LinkType field"));
172 os <<
"FaceEventNotification(";
174 switch (notification.
getKind())
177 os <<
"Kind: created, ";
180 os <<
"Kind: destroyed, ";
184 os <<
"FaceID: " << notification.
getFaceId() <<
", " 186 <<
"LocalUri: " << notification.
getLocalUri() <<
", " const std::string & getLocalUri() const
element_const_iterator elements_begin() 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)
Helper to prepend TLV block type type containing non-negative integer value.
FacePersistency getFacePersistency() const
EncodingImpl< EstimatorTag > EncodingEstimator
element_const_iterator elements_end() const
void parse() const
Parse wire buffer into subblocks.
represents a Face status change notification
FacePersistency m_facePersistency
Class representing a wire element of NDN-TLV packet format.
FaceEventNotification & setKind(FaceEventKind kind)
FaceScope getFaceScope() const
uint64_t readNonNegativeInteger(const Block &block)
Helper to read a non-negative integer from a block.
const std::string & getRemoteUri() const
EncodingImpl< EncoderTag > EncodingBuffer
Copyright (c) 2011-2015 Regents of the University of California.
FaceEventKind getKind() const
element_container::const_iterator element_const_iterator
std::ostream & operator<<(std::ostream &os, FaceScope faceScope)
void reset()
Reset wire buffer of the element.
const Block & wireEncode() const
encode FaceEventNotification
void wireDecode(const Block &wire)
decode FaceEventNotification
uint64_t getFaceId() const
a concept check for TLV abstraction with .wireEncode method
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...
LinkType getLinkType() const