23#ifndef INCLUDED_GR_MSG_QUEUE_H
24#define INCLUDED_GR_MSG_QUEUE_H
47 typedef boost::shared_ptr<msg_queue>
sptr;
81 bool empty_p()
const {
return d_count == 0; }
84 bool full_p()
const {
return d_limit != 0 && d_count >= d_limit; }
87 unsigned int count()
const {
return d_count; }
90 unsigned int limit()
const {
return d_limit; }
boost::shared_ptr< message > sptr
Definition message.h:42
abstract class of message handlers
Definition msg_handler.h:39
thread-safe message queue
Definition msg_queue.h:37
unsigned int count() const
return number of messages in queue
Definition msg_queue.h:87
boost::shared_ptr< msg_queue > sptr
Definition msg_queue.h:47
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)
unsigned int limit() const
return limit on number of message in queue. 0 -> unbounded
Definition msg_queue.h:90
bool empty_p() const
is the queue empty?
Definition msg_queue.h:81
void insert_tail(message::sptr msg)
Insert message at tail of queue.
bool full_p() const
is the queue full?
Definition msg_queue.h:84
message::sptr delete_head_nowait()
If there's a message in the q, delete it and return it. If no message is available,...
void handle(message::sptr msg)
Generic msg_handler method: insert the message.
Definition msg_queue.h:55
#define GR_RUNTIME_API
Definition gnuradio-runtime/include/gnuradio/api.h:30
boost::mutex mutex
Definition thread.h:48
boost::condition_variable condition_variable
Definition thread.h:50
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition basic_block.h:46