11 #ifndef INCLUDED_MSG_QUEUE_H
12 #define INCLUDED_MSG_QUEUE_H
23 typedef std::shared_ptr<msg_queue> msg_queue_sptr;
38 std::deque<pmt::pmt_t> d_msgs;
68 bool empty_p()
const {
return d_msgs.empty(); }
71 bool full_p()
const {
return d_limit != 0 && count() >= d_limit; }
74 unsigned int count()
const {
return d_msgs.size(); }
77 unsigned int limit()
const {
return d_limit; }
thread-safe message queue
Definition: messages/msg_queue.h:31
bool full_p() const
is the queue full?
Definition: messages/msg_queue.h:71
pmt::pmt_t delete_head_nowait()
If there's a message in the q, delete it and return it. If no message is available,...
void flush()
Delete all messages from the queue.
bool empty_p() const
is the queue empty?
Definition: messages/msg_queue.h:68
unsigned int count() const
return number of messages in queue
Definition: messages/msg_queue.h:74
pmt::pmt_t delete_head()
Delete message from head of queue and return it. Block if no message is available.
void insert_tail(pmt::pmt_t msg)
Insert message at tail of queue.
unsigned int limit() const
return limit on number of message in queue. 0 -> unbounded
Definition: messages/msg_queue.h:77
msg_queue(unsigned int limit)
#define GR_RUNTIME_API
Definition: gnuradio-runtime/include/gnuradio/api.h:18
msg_queue_sptr make_msg_queue(unsigned int limit=0)
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
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:83