GNU Radio C++ API Reference: gr::msg_queue Class Reference

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
gr::msg_queue Class Reference
Miscellaneous

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.
void | insert_tail (message::sptr msg)
| Insert message at tail of queue.
message::sptr | delete_head ()
| Delete message from head of queue and return it. Block if no message is available.
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
Public Member Functions inherited from gr::msg_handler
virtual | ~msg_handler ()

## Static Public Member Functions
static sptr | make (unsigned int limit=0)

## Detailed Description

thread-safe message queue

## Member Typedef Documentation

## ◆ sptr

typedef std::shared_ptr<msg_queue> gr::msg_queue::sptr

## Constructor & Destructor Documentation

## ◆ msg_queue()

gr::msg_queue::msg_queue | ( | unsigned int | limit | ) |

References limit().

## ◆ ~msg_queue()

gr::msg_queue::~msg_queue | ( |  | ) |
| override

## Member Function Documentation

## ◆ count()

unsigned int gr::msg_queue::count | ( |  | ) | const
| inline

return number of messages in queue

## ◆ delete_head()

message::sptr gr::msg_queue::delete_head | ( |  | ) |

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

## ◆ delete_head_nowait()

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.

## ◆ empty_p()

bool gr::msg_queue::empty_p | ( |  | ) | const
| inline

is the queue empty?

## ◆ flush()

void gr::msg_queue::flush | ( |  | ) |

Delete all messages from the queue.

## ◆ full_p()

bool gr::msg_queue::full_p | ( |  | ) | const
| inline

is the queue full?

## ◆ handle()

void gr::msg_queue::handle | ( | message::sptr | msg | ) |
| inlineoverridevirtual

Generic msg_handler method: insert the message.

Implements gr::msg_handler.

References insert_tail().

## ◆ insert_tail()

void gr::msg_queue::insert_tail | ( | message::sptr | msg | ) |

Insert message at tail of queue.

Parameters

  msg | message

Block if queue if full.

Referenced by handle().

## ◆ limit()

unsigned int gr::msg_queue::limit | ( |  | ) | const
| inline

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

Referenced by make(), and msg_queue().

## ◆ make()

sptr gr::msg_queue::make | ( | unsigned int | limit = 0 | ) |
| static

References limit().

The documentation for this class was generated from the following file:

- msg_queue.h