35 #include "fadingselectionevent.pb.h" 37 class EMANE::Events::FadingSelectionEvent::Implementation
41 selections_{selections}{}
57 if(!msg.ParseFromString(serialization))
64 for(
const auto & entry : msg.entries())
70 case EMANEMessage::FadingSelectionEvent::TYPE_NONE:
73 case EMANEMessage::FadingSelectionEvent::TYPE_NAKAGAMI:
80 selections.push_back({
static_cast<EMANE::NEMId>(entry.nemid()),fadingModel});
83 pImpl_.reset(
new Implementation{selections});
88 pImpl_{
new Implementation{selections}}{}
92 pImpl_{
new Implementation{rhs.getFadingSelections()}}{}
102 pImpl_{
new Implementation{{}}}
104 rval.pImpl_.swap(pImpl_);
109 rval.pImpl_.swap(pImpl_);
117 return pImpl_->getFadingSelections();
126 for(
auto & selection : pImpl_->getFadingSelections())
128 auto pFadingSelectionMessage = msg.add_entries();
130 pFadingSelectionMessage->set_nemid(selection.getNEMId());
132 switch(selection.getFadingModel())
135 pFadingSelectionMessage->set_model(EMANEMessage::FadingSelectionEvent::TYPE_NONE);
138 pFadingSelectionMessage->set_model(EMANEMessage::FadingSelectionEvent::TYPE_NAKAGAMI);
146 if(!msg.SerializeToString(&serialization))
151 return serialization;
std::string Serialization
const FadingSelections & getFadingSelections() const
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
Event interface is the base for all events.
An fading selection event is used to set the fading model for one or more NEMs.
FadingSelectionEvent & operator=(const FadingSelectionEvent &rhs)
std::list< FadingSelection > FadingSelections
Serialization serialize() const override
FadingSelectionEvent(const Serialization &serialization)