|
Yate
|
A message handler. More...
#include <yatengine.h>
Public Member Functions | |
| MessageHandler (const char *name, unsigned priority=100) | |
| virtual | ~MessageHandler () |
| virtual void | destruct () |
| virtual bool | received (Message &msg)=0 |
| unsigned | priority () const |
| const NamedString * | filter () const |
| void | setFilter (NamedString *filter) |
| void | setFilter (const char *name, const char *value) |
| void | clearFilter () |
Protected Member Functions | |
| void | cleanup () |
Friends | |
| class | MessageDispatcher |
| class | MessageRelay |
A message handler.
The purpose of this class is to hold a message received method that is called for matching messages. It holds as well the matching criteria and priority among other handlers.
| MessageHandler | ( | const char * | name, |
| unsigned | priority = 100 |
||
| ) | [explicit] |
Creates a new message handler.
| name | Name of the handled message - may be NULL |
| priority | Priority of the handler, 0 = top |
| virtual ~MessageHandler | ( | ) | [virtual] |
Handler destructor.
| void cleanup | ( | ) | [protected] |
Remove the handler from its dispatcher, remove any installed filter. This method is called internally from destruct and the destructor
| void clearFilter | ( | ) |
Remove and destroy any filter associated to this handler
| virtual void destruct | ( | ) | [virtual] |
Destroys the object, performs cleanup first
Reimplemented from GenObject.
| const NamedString* filter | ( | ) | const [inline] |
Retrieve the filter (if installed) associated to this handler
| unsigned priority | ( | ) | const [inline] |
Find out the priority of the handler
This method is called whenever the registered name matches the message.
| msg | The received message |
Implemented in MessageRelay.
Referenced by MessageRelay::received().
| void setFilter | ( | NamedString * | filter | ) |
Set a filter for this handler
| filter | Pointer to the filter to install, will be owned and destroyed by the handler |
| void setFilter | ( | const char * | name, |
| const char * | value | ||
| ) | [inline] |
Set a filter for this handler
| name | Name of the parameter to filter |
| value | Value of the parameter to filter |
References MessageHandler::setFilter().
Referenced by MessageHandler::setFilter().
1.7.6.1