35 #include "radiotorouter.pb.h" 37 class EMANE::Controls::R2RISelfMetricControlMessage::Implementation
42 u64BroadcastDataRatebps_{},
44 reportInteral_{Microseconds::zero()}{}
46 Implementation(std::uint64_t u64BroadcastDataRatebps,
47 std::uint64_t u64MaxDataRatebps,
49 u64BroadcastDataRatebps_{u64BroadcastDataRatebps},
50 u64MaxDataRatebps_{u64MaxDataRatebps},
51 reportInteral_{reportInteral}{}
55 return u64BroadcastDataRatebps_;
60 return u64MaxDataRatebps_;
65 return reportInteral_;
69 const std::uint64_t u64BroadcastDataRatebps_;
70 const std::uint64_t u64MaxDataRatebps_;
74 EMANE::Controls::R2RISelfMetricControlMessage::
75 R2RISelfMetricControlMessage(
const R2RISelfMetricControlMessage & msg):
77 pImpl_{
new Implementation{*msg.pImpl_}}
80 EMANE::Controls::R2RISelfMetricControlMessage::
81 R2RISelfMetricControlMessage(std::uint64_t u64BroadcastDataRatebps,
82 std::uint64_t u64MaxDataRatebps,
84 ControlMessage{IDENTIFIER},
85 pImpl_{
new Implementation{u64BroadcastDataRatebps,u64MaxDataRatebps,tvReportInteral}}{}
92 return pImpl_->getBroadcastDataRatebps();
97 return pImpl_->getMaxDataRatebps();
102 return pImpl_->getReportInterval();
107 std::uint64_t u64MaxDataRatebps,
119 EMANEMessage::RadioToRouterSelfMetric msg;
121 msg.set_broadcastdataratebps(pImpl_->getBroadcastDataRatebps());
122 msg.set_maxdataratebps(pImpl_->getMaxDataRatebps());
123 msg.set_reportinterval(std::chrono::duration_cast<DoubleSeconds>(pImpl_->getReportInterval()).count());
125 if(!msg.SerializeToString(&serialization))
130 return serialization;
136 EMANEMessage::RadioToRouterSelfMetric msg;
138 if(!msg.ParseFromString(serialization))
144 msg.maxdataratebps(),
std::string Serialization
SerializationException is thrown when an exception occurs during serialization or deserialization of ...
R2RISelfMetricControlMessage * clone() const override
std::uint64_t getMaxDataRatebps() const
Serialization serialize() const override
const Microseconds & getReportInterval() const
std::uint64_t getBroadcastDataRatebps() const
std::chrono::microseconds Microseconds
std::chrono::duration< double > DoubleSeconds
static R2RISelfMetricControlMessage * create(const Serialization &serialization)
~R2RISelfMetricControlMessage()
R2RI Self Metric Control Message is sent to an NEM's transport layer to specify the parameters necess...
ControlMessage(ControlMessageId id)