Pyro higlevel API
Classes | Public Member Functions | Friends | List of all members
os::MessageFilter Class Reference

Classes

class  Private
 

Public Member Functions

 MessageFilter ()
 
 MessageFilter (int32 nFilterCode, Handler *pcNewTarget)
 Constructor. More...
 
virtual ~MessageFilter ()
 
virtual MessageFilterResult Filter (Message *pcMessage, Handler **ppcHandler)
 Message filtering function. More...
 
int32 GetFilterCode () const
 Get filter code. More...
 
void SetFilterCode (int32 nCode)
 Set filter code. More...
 
void SetTarget (Handler *pcTarget)
 Set target for diverted messages. More...
 
HandlerGetTarget () const
 Get target for diverted messages. More...
 

Friends

class Looper
 
class Handler
 

Detailed Description

Description:
See Also
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Constructor & Destructor Documentation

MessageFilter::MessageFilter ( )
MessageFilter::MessageFilter ( int32  nFilterCode,
Handler pcTarget 
)
Description:
Creates a message filter that reroutes messages with a certain code to a specific Handler object.
Parameters
nFilterCodeThe filter code to respond to.
pcTargetNew target for messages.
See Also
Looper::AddCommonFilter()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::MessageFilter::Private::m_nFilterCode, and os::MessageFilter::Private::m_pcTarget.

MessageFilter::~MessageFilter ( )
virtual

Member Function Documentation

MessageFilterResult MessageFilter::Filter ( Message pcMessage,
Handler **  ppcHandler 
)
virtual
Description:
This method can be overridden in subclasses to attain the desired filtering. By default it diverts messages with a certain code to a different target, set with SetTarget().
Parameters
pcMessageThe message to filter.
ppcHandlerThe handler to send to. Can be changed in this function.
Returns
MF_DISPATCH_MESSAGE or MF_DISCARD_MESSAGE.
See Also
SetTarget(), SetFilterCode().
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::Message::GetCode(), os::MessageFilter::Private::m_nFilterCode, os::MessageFilter::Private::m_pcTarget, and os::MF_DISPATCH_MESSAGE.

int32 MessageFilter::GetFilterCode ( ) const
Handler * MessageFilter::GetTarget ( ) const
Description:
See Also
SetTarget()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::MessageFilter::Private::m_pcTarget.

void MessageFilter::SetFilterCode ( int32  nCode)
Description:
Messages with a Code field that matches the number specified with this method will be diverted by the Filter() function.
Parameters
nCodeWhat code to react to.
See Also
GetFilterCode(), Message::GetCode(), Filter()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::MessageFilter::Private::m_nFilterCode.

void MessageFilter::SetTarget ( Handler pcTarget)
Description:
Messages matched by Filter() will be diverted to the Handler you specify with this method.
Parameters
pcTargetWhere to send filtered messages.
See Also
GetTarget()
Author
Henrik Isaksson (henri.nosp@m.k@is.nosp@m.aksso.nosp@m.n.tk)

References os::MessageFilter::Private::m_pcTarget.

Friends And Related Function Documentation

friend class Handler
friend
friend class Looper
friend