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() <<
", "
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)
Helper to prepend TLV block type type containing non-negative integer value.
EncodingImpl< EstimatorTag > EncodingEstimator
FaceScope getFaceScope() const
represents a Face status change notification
FacePersistency m_facePersistency
Class representing a wire element of NDN-TLV packet format.
FaceEventNotification & setKind(FaceEventKind kind)
uint64_t readNonNegativeInteger(const Block &block)
Helper to read a non-negative integer from a block.
element_const_iterator elements_end() const
element_const_iterator elements_begin() const
EncodingImpl< EncoderTag > EncodingBuffer
Copyright (c) 2011-2015 Regents of the University of California.
uint64_t getFaceId() 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 std::string & getLocalUri() const
void parse() const
Parse wire buffer into subblocks.
const std::string & getRemoteUri() const
FacePersistency getFacePersistency() const
FaceEventKind getKind() const
bool hasWire() const
Check if the Block has fully encoded wire.
void wireDecode(const Block &wire)
decode FaceEventNotification
const Block & wireEncode() const
encode FaceEventNotification
a concept check for TLV abstraction with .wireEncode method
a concept check for TLV abstraction with .wireDecode method and constructible from Block ...