1 #ifndef theplu_yat_utility_queue
2 #define theplu_yat_utility_queue
21 #include <boost/thread.hpp>
64 typedef typename std::deque<T>::size_type
size_type;
83 boost::unique_lock<boost::mutex> lock(mutex_);
97 boost::unique_lock<boost::mutex> lock(mutex_);
99 condition_.wait(lock);
115 boost::unique_lock<boost::mutex> lock(mutex_);
120 condition_.notify_one();
129 boost::unique_lock<boost::mutex> lock(mutex_);
140 boost::unique_lock<boost::mutex> lock(mutex_);
154 boost::unique_lock<boost::mutex> lock(mutex_);
161 mutable boost::mutex mutex_;
162 boost::condition_variable condition_;
165 const std::deque<T>& q(
void)
const
167 boost::unique_lock<boost::mutex> lock(mutex_);
std::deque< T >::size_type size_type
Definition: Queue.h:64
bool empty(void) const
Definition: Queue.h:81
bool try_pop(T &value)
Definition: Queue.h:138
Queue(void)
Create a Queue with no elements.
Definition: Queue.h:69
Multi-thread safe queue.
Definition: Queue.h:55
Queue(const Queue &other)
Copy constructor.
Definition: Queue.h:76
T value_type
Type of object stored in Queue.
Definition: Queue.h:59
void pop(T &value)
access next element in queue
Definition: Queue.h:95
void push(const T &t)
insert an element into container
Definition: Queue.h:113
size_type size(void) const
Definition: Queue.h:127
Queue & operator=(const Queue &lhs)
assignment operator
Definition: Queue.h:152