6 #ifndef UTILS_ATOMIC_QUEUE_H 7 #define UTILS_ATOMIC_QUEUE_H 22 std::lock_guard<std::mutex> lock(mutex_);
23 return this->queue_.front();
28 std::lock_guard<std::mutex> lock(mutex_);
29 T value = this->queue_.front();
36 std::lock_guard<std::mutex> lock(mutex_);
37 this->queue_.push(value);
42 std::lock_guard<std::mutex> lock(mutex_);
43 bool check = this->queue_.empty();
49 std::lock_guard<std::mutex> lock(mutex_);
50 return this->queue_.size();
53 mutable std::mutex mutex_;
size_t GetSize() const
Get the number of records currently in the queue.
Definition: AtomicQueue.h:47
Queue which allows calling members from multiple threads without interference.
Definition: AtomicQueue.h:16
T & GetNext()
Get next record from queue.
Definition: AtomicQueue.h:20
Extensions to the standard libraries.
Definition: AtomicQueue.h:11
bool IsEmpty() const
Check, whether the queue is empty.
Definition: AtomicQueue.h:40
T Pop()
Get next record from queue and remove it from the queue.
Definition: AtomicQueue.h:26
void Push(T value)
Add new record to queue.
Definition: AtomicQueue.h:34