35 #include "pathlossevent.pb.h" 37 class EMANE::Events::PathlossEvent::Implementation
41 pathlosses_{pathlosses}{}
57 if(!msg.ParseFromString(serialization))
64 for(
const auto & pathloss : msg.pathlosses())
66 pathlosses.push_back({
static_cast<EMANE::NEMId>(pathloss.nemid()),
67 pathloss.forwardpathlossdb(),
68 pathloss.reversepathlossdb()});
71 pImpl_.reset(
new Implementation{pathlosses});
76 pImpl_{
new Implementation{pathlosses}}{}
80 pImpl_{
new Implementation{rhs.getPathlosses()}}{}
90 pImpl_{
new Implementation{{}}}
92 rval.pImpl_.swap(pImpl_);
97 rval.pImpl_.swap(pImpl_);
105 return pImpl_->getPathlosses();
114 for(
auto & pathloss : pImpl_->getPathlosses())
116 auto pPathlossMessage = msg.add_pathlosses();
118 pPathlossMessage->set_nemid(pathloss.getNEMId());
120 pPathlossMessage->set_forwardpathlossdb(pathloss.getForwardPathlossdB());
122 pPathlossMessage->set_reversepathlossdb(pathloss.getReversePathlossdB());
125 if(!msg.SerializeToString(&serialization))
130 return serialization;
std::string Serialization
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
Event interface is the base for all events.
A pathloss event is used to set the pathloss from one or more transmitting NEMs to a receiving NEM...
Serialization serialize() const override
PathlossEvent & operator=(const PathlossEvent &rhs)
std::list< Pathloss > Pathlosses
PathlossEvent(const Serialization &serialization)
const Pathlosses & getPathlosses() const