7 #ifndef NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
8 #define NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
13 #include "../encoding/tlv-nfd.hpp"
14 #include "../encoding/encoding-buffer.hpp"
103 m_remoteUri = remoteUri;
117 m_localUri = localUri;
138 std::string m_remoteUri;
139 std::string m_localUri;
142 mutable Block m_wire;
157 size_t totalLength = 0;
162 reinterpret_cast<const uint8_t*>(m_localUri.c_str()), m_localUri.size());
164 reinterpret_cast<const uint8_t*>(m_remoteUri.c_str()), m_remoteUri.size());
170 totalLength += encoder.prependVarNumber(totalLength);
187 m_wire = buffer.block();
195 throw Error(
"expecting FaceEventNotification block");
206 throw Error(
"missing required FaceEventKind field");
214 throw Error(
"missing required FaceId field");
218 m_remoteUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
222 throw Error(
"missing required Uri field");
226 m_localUri.assign(reinterpret_cast<const char*>(val->value()), val->value_size());
230 throw Error(
"missing required LocalUri field");
238 throw Error(
"missing required FaceFlags field");
245 os <<
"FaceEventNotification(";
247 switch (notification.
getKind())
250 os <<
"Kind: created, ";
253 os <<
"Kind: destroyed, ";
257 os <<
"FaceID: " << notification.
getFaceId() <<
", "
259 <<
"LocalUri: " << notification.
getLocalUri() <<
", "
260 <<
"Flags: " << notification.
getFlags()
268 #endif // NDN_MANAGEMENT_NFD_FACE_EVENT_NOTIFICATION_HPP
const std::string & getRemoteUri() const
std::ostream & operator<<(std::ostream &os, const ControlParameters ¶meters)
Error(const std::string &what)
FaceEventNotification & setLocalUri(const std::string &localUri)
FaceEventNotification & setFlags(uint64_t flags)
implements getters to each face flag
represents a Face status change notification
Class representing wire element of the NDN packet.
FaceEventNotification & setRemoteUri(const std::string &remoteUri)
FaceEventNotification(const Block &block)
uint64_t readNonNegativeInteger(const Block &block)
element_const_iterator elements_end() const
element_const_iterator elements_begin() const
const std::string & getLocalUri() const
FaceEventNotification & setKind(FaceEventKind kind)
element_container::const_iterator element_const_iterator
FaceEventNotification & setFaceId(uint64_t faceId)
void reset()
Reset wire buffer of the element.
void parse() const
Parse wire buffer into subblocks.
uint64_t getFlags() const
FaceEventKind getKind() const
uint64_t getFaceId() const
bool hasWire() const
Check if the Block has fully encoded wire.
size_t prependNonNegativeIntegerBlock(EncodingImpl< P > &encoder, uint32_t type, uint64_t number)
helper methods
void wireDecode(const Block &wire)
decode FaceEventNotification
const Block & wireEncode() const
encode FaceEventNotification
size_t prependByteArrayBlock(EncodingImpl< P > &encoder, uint32_t type, const uint8_t *array, size_t arraySize)
Class representing wire element of the NDN packet.