11 #ifndef INCLUDED_GR_MSG_QUEUE_H
12 #define INCLUDED_GR_MSG_QUEUE_H
35 typedef std::shared_ptr<msg_queue>
sptr;
69 bool empty_p()
const {
return d_count == 0; }
72 bool full_p()
const {
return d_limit != 0 && d_count >= d_limit; }
75 unsigned int count()
const {
return d_count; }
78 unsigned int limit()
const {
return d_limit; }
std::shared_ptr< message > sptr
Definition: message.h:30
abstract class of message handlers
Definition: msg_handler.h:27
thread-safe message queue
Definition: msg_queue.h:25
unsigned int count() const
return number of messages in queue
Definition: msg_queue.h:75
std::shared_ptr< msg_queue > sptr
Definition: msg_queue.h:35
msg_queue(unsigned int limit)
message::sptr delete_head()
Delete message from head of queue and return it. Block if no message is available.
void flush()
Delete all messages from the queue.
static sptr make(unsigned int limit=0)
void handle(message::sptr msg) override
Generic msg_handler method: insert the message.
Definition: msg_queue.h:43
unsigned int limit() const
return limit on number of message in queue. 0 -> unbounded
Definition: msg_queue.h:78
bool empty_p() const
is the queue empty?
Definition: msg_queue.h:69
void insert_tail(message::sptr msg)
Insert message at tail of queue.
bool full_p() const
is the queue full?
Definition: msg_queue.h:72
message::sptr delete_head_nowait()
If there's a message in the q, delete it and return it. If no message is available,...
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
GR_RUNTIME_API const pmt::pmt_t msg()
boost::mutex mutex
Definition: thread.h:37
boost::condition_variable condition_variable
Definition: thread.h:39
GNU Radio logging wrapper.
Definition: basic_block.h:29