34 #include "onehopneighborsevent.pb.h" 36 class EMANE::Models::IEEE80211ABG::OneHopNeighborsEvent::Implementation
39 Implementation(
NEMId id,
const NbrSet & neighbors) :
66 if(!msg.ParseFromString(serialization))
73 for(
const auto & iter : msg.neighbors())
75 neighbors.insert(static_cast<NEMId>(iter.nemid()));
78 pImpl_.reset(
new Implementation{
static_cast<NEMId>(msg.eventsource()), neighbors});
83 pImpl_{
new Implementation{id, neighbors}}{}
93 return pImpl_->getNeighbors();
99 return pImpl_->getEventSource();
110 msg.set_eventsource(pImpl_->getEventSource());
112 for(
auto & neighbor : pImpl_->getNeighbors())
114 auto iter = msg.add_neighbors();
116 iter->set_nemid(neighbor);
119 if(!msg.SerializeToString(&serialization))
124 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