MessageHandler Class Reference

A message handler. More...

#include <yatengine.h>

Inheritance diagram for MessageHandler:

String GenObject MessageRelay

List of all members.

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 NamedStringfilter () const
void setFilter (NamedString *filter)
void setFilter (const char *name, const char *value)
void clearFilter ()

Friends

class MessageDispatcher


Detailed Description

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.


Constructor & Destructor Documentation

MessageHandler ( const char *  name,
unsigned  priority = 100 
)

Creates a new message handler.

Parameters:
name Name of the handled message - may be NULL
priority Priority of the handler, 0 = top

virtual ~MessageHandler (  )  [virtual]

Handler destructor.


Member Function Documentation

virtual void destruct (  )  [virtual]

Destroys the object, performs cleanup first

Reimplemented from GenObject.

virtual bool received ( Message msg  )  [pure virtual]

This method is called whenever the registered name matches the message.

Parameters:
msg The received message
Returns:
True to stop processing, false to try other handlers

Implemented in MessageRelay.

unsigned priority (  )  const [inline]

Find out the priority of the handler

Returns:
Stored priority of the handler, 0 = top

const NamedString* filter (  )  const [inline]

Retrive the filter (if installed) associated to this handler

void setFilter ( NamedString filter  ) 

Set a filter for this handler

Parameters:
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

Parameters:
name Name of the parameter to filter
value Value of the parameter to filter

void clearFilter (  ) 

Remove and destroy any filter associated to this handler


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

Generated on Mon Aug 11 16:18:52 2008 for Yate by  doxygen 1.5.6