Class IterablePriorityQueue

Synopsis

#include <src/easylogging++.h>

template<typename T, typename Container = std::vector<T>, typename Comparator = std::less<typename Container::value_type>>
class IterablePriorityQueue : public IterableContainer<T, Container>,
  public std::priority_queue<T, Container, Comparator>

Description

Implements IterableContainer and provides iterable std::priority_queue class.

Inheritance

Ancestors: IterableContainer, std::priority_queue< T, std::vector< T >, std::less< typename Container::value_type > >

Methods

IterablePriorityQueue

Source

Lines 2815-2830 in src/easylogging++.h.

template<typename T, typename Container = std::vector<T>, typename Comparator = std::less<typename Container::value_type>>
class IterablePriorityQueue : public IterableContainer<T, Container>,
  public std::priority_queue<T, Container, Comparator> {
 public:
  IterablePriorityQueue(std::priority_queue<T, Container, Comparator> queue_) {
    std::size_t count_ = 0;
    while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) {
      this->push(queue_.top());
      queue_.pop();
    }
  }
 private:
  inline Container& getContainer(void) {
    return this->c;
  }
};





Add Discussion

Log in to comment