class MessageQueue

A message queue. More...

Full nameTelEngine::MessageQueue
Definition#include <yatengine.h>
InheritsTelEngine::MessageHook [public ], TelEngine::Mutex [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

MessageQueue class allows to create a private queue for a message who matches the specified filters.

 MessageQueue (const char* hookName, int numWorkers = 0)

MessageQueue

Creates a new message queue.

Parameters:
hookNameName of the message served by this queue
numWorkersThe number of workers who serve this queue

 ~MessageQueue ()

~MessageQueue

Destroys the message queue

bool  enqueue (Message* msg)

enqueue

[virtual]

Append a message in the queue

Parameters:
msgThe message to enqueue, will be destroyed after the processing is done

Returns: True if successfully queued, false otherwise

Reimplemented from MessageHook.

bool  dequeue ()

dequeue

Process a message from the waiting queue

Returns: False if the message queue is empty

void  addFilter (const char* name, const char* value)

addFilter

Add a new filter to this queue

Parameters:
nameThe filter name
valueThe filter value

void  removeFilter (const String& name)

removeFilter

Remove a filter form this queue

Parameters:
nameThe filter name

void  clear ()

clear

[virtual]

Clear private data

Reimplemented from MessageHook.

void  removeThread (Thread* thread)

removeThread

Remove a thread from workers list

Parameters:
threadThe thread to remove

inline unsigned int  count ()

count

[const]

Helper method to obtain the number of unprocessed messages in the queue

Returns: The number of queued messages.

Reimplemented from Mutex.

inline const NamedList&  getFilters ()

getFilters

[const]

Obtain the filter list for this queue

Returns: The filter list

bool  matchesFilter (const Message& msg)

matchesFilter

[virtual]

Check if the given message can be inserted in this queue

Parameters:
msgThe message to check

Returns: True if the message can be inserted in this queue

Reimplemented from MessageHook.

void  received (Message& msg)

received

[protected virtual]

Callback method for message processing Default calls Engine::dispatch

Parameters:
msgThe message to process


Generated by: paulc on bussard on Sun Oct 20 21:06:06 2013, using kdoc 2.0a54.