24template <
class T,
typename StorageType = std::deque<T> >
50 void add(
const T& item)
60 template<
class Iterator>
61 void readd(Iterator begin, Iterator end)
81 template<
class Checker>
82 bool next(T& result, Checker& check)
90 if (!check.Process(result))
98 T&
peek(
bool autoUnlock =
false)
102 T& result =
_queue.front();
134 this->_lock.unlock();
void add(const T &item)
Adds an item to the queue.
volatile bool _canceled
Cancellation flag.
void unlock()
Unlocks the queue.
void readd(Iterator begin, Iterator end)
Adds items back to front of the queue.
StorageType _queue
Storage backing the queue.
std::mutex _lock
Lock access to the queue.
bool cancelled()
Checks if the queue is cancelled.
bool empty()
! Checks if we're empty or not with locks held
void lock()
Locks the queue for access.
void pop_front()
! Calls pop_front of the queue
void cancel()
Cancels the queue.
bool next(T &result)
Gets the next result in the queue, if any.
bool next(T &result, Checker &check)
virtual ~LockedQueue()
Destroy a LockedQueue.
LockedQueue()
Create a LockedQueue.
T & peek(bool autoUnlock=false)
Peeks at the top of the queue. Check if the queue is empty before calling! Remember to unlock after u...