The message queue class is used to send and wait for Message objects, see MessageThread.
More...
#include <murl_util_message_queue.h>
The message queue class is used to send and wait for Message objects, see MessageThread.
|
| | MessageQueue () |
| | The default constructor. More...
|
| |
|
virtual | ~MessageQueue () |
| | The destructor.
|
| |
| UInt32 | GetMaxMessageQueueLength () const |
| | Get the maximum number of messages the queue can store. More...
|
| |
| void | SetMaxMessageQueueLength (UInt32 maxLength) |
| | Set the maximum number of messages the queue can store. More...
|
| |
|
void | ClearMessageQueue () |
| | Clear the message queue.
|
| |
| Bool | SendMessage (Message::AutoPtr message) |
| | Add a message to the message queue. More...
|
| |
| Bool | SendSyncMessage (Message::AutoPtr message) |
| | Add a message the the message queue and wait until the message is delivered and processed, see Message. More...
|
| |
| Result | WaitMessage (Message::AutoPtr &message, UInt32 msgIdStart, UInt32 msgIdEnd) |
| | Wait for a message. More...
|
| |
| Result | WaitMessage (Message::AutoPtr &message, const System::Time &timeout, UInt32 msgIdStart, UInt32 msgIdEnd) |
| | Wait for a message with time out. More...
|
| |
| Result | GetMessage (Message::AutoPtr &message, UInt32 msgIdStart, UInt32 msgIdEnd) |
| | Get a message from the message queue. More...
|
| |
| Result | PeekMessage (const Message *&message, UInt32 msgIdStart, UInt32 msgIdEnd) |
| | Peek a message from the message queue. More...
|
| |
◆ Result
Enumeration of the message queue results.
| Enumerator |
|---|
| FAILED | Receiving a message failed.
|
| RECEIVED | Received a message.
|
| TIMEOUT | Timeout receiving a message.
|
| QUIT | Received the quit message.
|
◆ MessageQueue()
| Murl::Util::MessageQueue::MessageQueue |
( |
| ) |
|
The default constructor.
Set the message queue length to 1000.
◆ GetMaxMessageQueueLength()
| UInt32 Murl::Util::MessageQueue::GetMaxMessageQueueLength |
( |
| ) |
const |
Get the maximum number of messages the queue can store.
The default message queue length is 1000.
- Returns
- The maximum number of messages the queue can store.
◆ SetMaxMessageQueueLength()
| void Murl::Util::MessageQueue::SetMaxMessageQueueLength |
( |
UInt32 |
maxLength | ) |
|
Set the maximum number of messages the queue can store.
- Parameters
-
| maxLength | The maximum number of messages the queue can store. |
◆ SendMessage()
Add a message to the message queue.
- Parameters
-
| message | The message to send. |
- Returns
- true if successful, false if the maximum message queue length is reached.
◆ SendSyncMessage()
Add a message the the message queue and wait until the message is delivered and processed, see Message.
- Parameters
-
| message | The message to send. |
- Returns
- true if successful, false if the maximum message queue length is reached.
◆ WaitMessage() [1/2]
Wait for a message.
- Parameters
-
| message | The message return value. The message returned is removed from the message queue. |
| msgIdStart | Message identifier range start. Use Message::ID_ANY to receive any message (set msgIdEnd to zero). |
| msgIdEnd | Message identifier range end. |
- Returns
- The message queue result.
◆ WaitMessage() [2/2]
Wait for a message with time out.
- Parameters
-
| message | The message return value. The message returned is removed from the message queue. |
| timeout | The maximum time to wait. |
| msgIdStart | Message identifier range start. Use Message::ID_ANY to receive any message (set msgIdEnd to zero). |
| msgIdEnd | Message identifier range end. |
- Returns
- The message queue result.
◆ GetMessage() [1/2]
Get a message from the message queue.
- Parameters
-
| message | The message return value. The message returned is removed from the message queue. |
| msgIdStart | Message identifier range start. Use Message::ID_ANY to receive any message (set msgIdEnd to zero). |
| msgIdEnd | Message identifier range end. |
- Returns
- The message queue result.
◆ PeekMessage()
Peek a message from the message queue.
Checks if a message is in the message queue but does not remove the message from the message queue.
- Parameters
-
| message | The message return value. |
| msgIdStart | Message identifier range start. Use Message::ID_ANY to receive any message (set msgIdEnd to zero). |
| msgIdEnd | Message identifier range end. |
- Returns
- The message queue result.
◆ GetMessage() [2/2]
Get a message raw pointer from the message queue.
- Parameters
-
| message | The message return value. |
| msgIdStart | Message identifier range start. Use Message::ID_ANY to receive any message (set msgIdEnd to zero). |
| msgIdEnd | Message identifier range end. |
| remove | If true remove the message from the queue. |
- Returns
- The message queue result.
The documentation for this class was generated from the following file:
- murl_util_message_queue.h