#include <packetmessageque.h>
Public Methods | |
PacketMessageQue (bool bSetEvents=true) | |
virtual | ~PacketMessageQue () |
void | add (PacketMessage *) |
Adds msg to the end of the list. More... | |
PacketMessage * | get () |
Returns the first item, and removes from the list. More... | |
bool | isEmpty () |
Checks if there are any messages in the message que. More... | |
void | purge () |
Remove all items from the msg list que. More... |
Works like a FIFO stack. Messages are added to the end of the list, and retrieved from the head of the list.
In the following example, we have added "Aa", "Bb" and "Cc" to the list in that order.
---[head]--- [ Aa ] [ Bb ] [ Cc ] ---[tail]---
When you call the get method, it will retrieve the head item - "Aa" - and remove it from the list. The next call will retrieve "Bb" and so on.
The server uses the message que to store all the messages that have been parsed. It then runs through the que and calls your message pump (see SimpleServer::processSingleMsg for further details.)
|
Constructs a message que. When events are set, whenever a message is added to the que, the event will fire. This event however is not in use at the moment.
|
|
Deletes all messages in this message que. |
|
Adds msg to the end of the list. Add a message to the tail end of the message que. If the event flag is set, the event will be signaled.
|
|
Returns the first item, and removes from the list. Checks if there are any messages in the que and returns head (first) message if there is one. If there is a message pointer to be returned, it is removed from the message que, so subsiquent calls will return the next one. Works like a FIFO stack.
|
|
Checks if there are any messages in the message que.
|
|
Remove all items from the msg list que.
|