Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

gr_msg_queue Class Reference

#include <gr_msg_queue.h>

Inheritance diagram for gr_msg_queue:

Inheritance graph
[legend]
Collaboration diagram for gr_msg_queue:

Collaboration graph
[legend]
List of all members.

Detailed Description

thread-safe message queue


Public Member Functions

 gr_msg_queue (unsigned int limit)
 ~gr_msg_queue ()
void handle (gr_message_sptr msg)
 Generic msg_handler method: insert the message.
void insert_tail (gr_message_sptr msg)
 Insert message at tail of queue.
gr_message_sptr delete_head ()
 Delete message from head of queue and return it. Block if no message is available.
gr_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.
void flush ()
 Delete all messages from the queue.
bool empty_p () const
 is the queue empty?
bool full_p () const
 is the queue full?
unsigned int count () const
 return number of messages in queue
unsigned int limit () const
 return limit on number of message in queue. 0 -> unbounded


Constructor & Destructor Documentation

gr_msg_queue::gr_msg_queue unsigned int  limit  ) 
 

gr_msg_queue::~gr_msg_queue  ) 
 


Member Function Documentation

unsigned int gr_msg_queue::count  )  const [inline]
 

return number of messages in queue

gr_message_sptr gr_msg_queue::delete_head  ) 
 

Delete message from head of queue and return it. Block if no message is available.

gr_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.

bool gr_msg_queue::empty_p  )  const [inline]
 

is the queue empty?

void gr_msg_queue::flush  ) 
 

Delete all messages from the queue.

bool gr_msg_queue::full_p  )  const [inline]
 

is the queue full?

void gr_msg_queue::handle gr_message_sptr  msg  )  [inline, virtual]
 

Generic msg_handler method: insert the message.

Implements gr_msg_handler.

void gr_msg_queue::insert_tail gr_message_sptr  msg  ) 
 

Insert message at tail of queue.

Parameters:
msg message
Block if queue if full.

unsigned int gr_msg_queue::limit  )  const [inline]
 

return limit on number of message in queue. 0 -> unbounded


The documentation for this class was generated from the following files:
Generated on Sat Jul 8 17:13:11 2006 for GNU Radio 2.x by  doxygen 1.4.1