thread-safe message queue More...
#include <gnuradio/msg_queue.h>
Public Types | |
typedef std::shared_ptr< msg_queue > | sptr |
Public Member Functions | |
msg_queue (unsigned int limit) | |
~msg_queue () override | |
void | handle (message::sptr msg) override |
Generic msg_handler method: insert the message. More... | |
void | insert_tail (message::sptr msg) |
Insert message at tail of queue. More... | |
message::sptr | delete_head () |
Delete message from head of queue and return it. Block if no message is available. More... | |
message::sptr | delete_head_nowait () |
If there's a message in the q, delete it and return it. If no message is available, return 0. More... | |
void | flush () |
Delete all messages from the queue. More... | |
bool | empty_p () const |
is the queue empty? More... | |
bool | full_p () const |
is the queue full? More... | |
unsigned int | count () const |
return number of messages in queue More... | |
unsigned int | limit () const |
return limit on number of message in queue. 0 -> unbounded More... | |
Public Member Functions inherited from gr::msg_handler | |
virtual | ~msg_handler () |
virtual void | handle (message::sptr msg)=0 |
handle msg More... | |
Static Public Member Functions | |
static sptr | make (unsigned int limit=0) |
thread-safe message queue
typedef std::shared_ptr<msg_queue> gr::msg_queue::sptr |
gr::msg_queue::msg_queue | ( | unsigned int | limit | ) |
|
override |
|
inline |
return number of messages in queue
message::sptr gr::msg_queue::delete_head | ( | ) |
Delete message from head of queue and return it. Block if no message is available.
message::sptr gr::msg_queue::delete_head_nowait | ( | ) |
If there's a message in the q, delete it and return it. If no message is available, return 0.
|
inline |
is the queue empty?
void gr::msg_queue::flush | ( | ) |
Delete all messages from the queue.
|
inline |
is the queue full?
|
inlineoverridevirtual |
Generic msg_handler method: insert the message.
Implements gr::msg_handler.
References gr::msgport_names::msg().
void gr::msg_queue::insert_tail | ( | message::sptr | msg | ) |
Insert message at tail of queue.
msg | message |
Block if queue if full.
|
inline |
return limit on number of message in queue. 0 -> unbounded
|
static |