34 #include "onehopneighborsevent.pb.h" 36 class EMANE::Models::IEEE80211ABG::OneHopNeighborsEvent::Implementation
39 Implementation(
NEMId id,
const NbrSet & neighbors) :
65 EMANEEventMessage::OneHopNeighborsEvent msg;
67 if(!msg.ParseFromString(serialization))
74 for(
const auto & iter : msg.neighbors())
76 neighbors.insert(static_cast<NEMId>(iter.nemid()));
79 pImpl_.reset(
new Implementation{
static_cast<NEMId>(msg.eventsource()), neighbors});
84 pImpl_{
new Implementation{id, neighbors}}{}
94 return pImpl_->getNeighbors();
100 return pImpl_->getEventSource();
109 EMANEEventMessage::OneHopNeighborsEvent msg;
111 msg.set_eventsource(pImpl_->getEventSource());
113 for(
auto & neighbor : pImpl_->getNeighbors())
115 auto iter = msg.add_neighbors();
117 iter->set_nemid(neighbor);
120 if(!msg.SerializeToString(&serialization))
125 return serialization;
std::string Serialization
NEMId getEventSource() const
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
Event interface is the base for all events.
OneHopNeighborsEvent(const std::string &sSerialization)
const NbrSet & getNeighbors() const
std::set< EMANE::NEMId > NbrSet
Serialization serialize() const override