From b214cde5b4a833e1826ec6850b95bf1938c8b0a0 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 4 Mar 2015 17:48:07 +0100 Subject: Remove Queue class which uses std::list and use native std::queue --- src/util/container.h | 61 ---------------------------------------------------- 1 file changed, 61 deletions(-) (limited to 'src/util') diff --git a/src/util/container.h b/src/util/container.h index 3ffd885e4..7945df54b 100644 --- a/src/util/container.h +++ b/src/util/container.h @@ -183,67 +183,6 @@ private: std::map m_value_to_id; }; -/* -FIFO queue (well, actually a FILO also) -*/ -template -class Queue -{ -public: - Queue(): - m_list_size(0) - {} - - void push_back(T t) - { - m_list.push_back(t); - ++m_list_size; - } - - void push_front(T t) - { - m_list.push_front(t); - ++m_list_size; - } - - T pop_front() - { - if(m_list.empty()) - throw ItemNotFoundException("Queue: queue is empty"); - - typename std::list::iterator begin = m_list.begin(); - T t = *begin; - m_list.erase(begin); - --m_list_size; - return t; - } - T pop_back() - { - if(m_list.empty()) - throw ItemNotFoundException("Queue: queue is empty"); - - typename std::list::iterator last = m_list.back(); - T t = *last; - m_list.erase(last); - --m_list_size; - return t; - } - - u32 size() - { - return m_list_size; - } - - bool empty() - { - return m_list.empty(); - } - -protected: - std::list m_list; - u32 m_list_size; -}; - /* Thread-safe FIFO queue (well, actually a FILO also) */ -- cgit v1.2.3