42 #ifndef CORE_MTQUEUE_H_
43 #define CORE_MTQUEUE_H_
55 mutex_(sc_gen_unique_name(
"mutex_")),
56 cond_(sc_gen_unique_name(
"cond_")) {
63 while (queue_.empty()) {
68 auto item = queue_.front();
80 while (queue_.empty()) {
85 item = queue_.front();
111 queue_.push(std::move(item));
120 void size(
int& qsize) {
122 qsize = queue_.size();
127 std::queue<T> queue_;
133 #endif // CORE_MTQUEUE_H_
A multiple-producer, multiple-consumer, thread-safe queue implemented using SystemC primitives The MT...
Definition: MTQueue.h:49
void push(T &&item)
Push an item onto the MTQueue (explicit move)
Definition: MTQueue.h:108
T pop()
Pop the top element from the MTQueue and return a copy.
Definition: MTQueue.h:62
void pop(T &item)
Pop the top element from the MTQueue and copy it into the output argument.
Definition: MTQueue.h:79
void push(const T &item)
Push an item onto the MTQueue.
Definition: MTQueue.h:95
MTQueue()
Construct a MTQueue.
Definition: MTQueue.h:54