39 struct hash<
std::pair<EMANE::NEMId,std::uint64_t>>
41 typedef std::pair<EMANE::NEMId,std::uint64_t> argument_type;
42 typedef std::size_t result_type;
44 result_type operator()(argument_type
const& s)
const 46 result_type
const h1{std::hash<EMANE::NEMId>()(s.first)};
47 result_type
const h2{std::hash<std::uint64_t>()(s.second)};
48 return h1 ^ (h2 << 1);
58 {
"NEM",
"Frequency",
"Rx Power",
"Last Packet Time"},
59 StatisticProperties::NONE,
60 "Shows the calculated receive power for the last received packet.");
64 std::uint64_t u64Frequency,
70 if(receivePowerTableSet_.count(key))
72 pReceivePowerTable_->setRow(key,
77 Any{std::chrono::duration_cast<
DoubleSeconds>(rxTime.time_since_epoch()).count()}});
81 pReceivePowerTable_->addRow(key,
86 Any{std::chrono::duration_cast<
DoubleSeconds>(rxTime.time_since_epoch()).count()}});
88 receivePowerTableSet_.insert(key);
void update(NEMId nemId, std::uint64_t u64Frequency, double dReceivePower, const TimePoint &rxTime)
The StatisticRegistrar allows NEM layers to register statistics and statistic tables. Statistics and Statistic tables are owned by the emulator framework and a borrowed reference is returned to the registering NEM layer.
StatisticTable< Key, Compare, scolumn > * registerTable(const std::string &sName, const StatisticTableLabels &labels, const StatisticProperties &properties=StatisticProperties::NONE, const std::string &sDescription="")
std::pair< NEMId, std::uint64_t > ReceivePowerTableKey
std::chrono::duration< double > DoubleSeconds
Clock::time_point TimePoint
The Any class can contain an instance of one of any type in its support type set. ...
void registerStatistics(StatisticRegistrar ®istrar)