Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

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

void clearFilter  ) 
 

Remove and destroy any filter associated to this handler

const NamedString* filter  )  const [inline]
 

Retrive the filter (if installed) associated to this handler

unsigned priority  )  const [inline]
 

Find out the priority of the handler

Returns:
Stored priority of the handler, 0 = top

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.

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


The documentation for this class was generated from the following file:
Generated on Mon Sep 18 20:56:12 2006 for Yate by  doxygen 1.4.4