65 size_t result{numDiscards_};
90 std::pair<EMANE::Models::RFPipe::DownstreamQueueEntry,bool>
106 std::vector<EMANE::Models::RFPipe::DownstreamQueueEntry>
109 std::vector<DownstreamQueueEntry> result;
112 while(queue_.size() >= maxQueueSize_)
116 result.push_back(std::move(queue_.front()));
121 queue_.push(std::move(entry));
123 if(queue_.size() > pNumHighWaterMark_->
get())
125 *pNumHighWaterMark_ = queue_.size();
136 return queue_.front();
std::pair< DownstreamQueueEntry, bool > dequeue()
removes an element from the queue
std::vector< DownstreamQueueEntry > enqueue(DownstreamQueueEntry &entry)
Adds an element to the queue.
RFPipe MAC downstream queue entry definition.
size_t getNumDiscards(bool bClear)
Returns the number of discards.
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.
void registerStatistics(StatisticRegistrar &statisticRegistrar)
StatisticNumeric< T > * registerNumeric(const std::string &sName, const StatisticProperties &properties=StatisticProperties::NONE, const std::string &sDescription="")
const std::uint8_t QUEUE_SIZE_DEFAULT
DownstreamQueue()
Constructor.
size_t getMaxCapacity()
Returns the max size of the queue.
size_t getCurrentDepth()
Returns the current size of the queue.
~DownstreamQueue()
Destructor.
const DownstreamQueueEntry & peek()
Returns a reference to the element to be pop'd next.