interreality.org [VOS]
[Home] [About]
[Screenshots]
[Download]
[News]
[Community]
[Documentation] [Manual]
[Bugs & Requests] [Wiki]

VUtil::ListenerTask< Listener, Event > Class Template Reference

#include <vos/vos/listener.hh>

Inheritance diagram for VUtil::ListenerTask< Listener, Event >:

VUtil::Task List of all members.

Detailed Description

template<class Listener, class Event>
class VUtil::ListenerTask< Listener, Event >

Template class used to define the task of delivering a particular event object to a particular listener object.

An Event class supplied to this template must implement the following method, which makes the event deliver itself to the supplied Listener:

        void Event::deliverTo(Listener*);

Definition at line 51 of file listener.hh.

Public Member Functions


Constructor & Destructor Documentation

template<class Listener, class Event>
VUtil::ListenerTask< Listener, Event >::ListenerTask ( Listener *  li,
Event *  ev 
) [inline]

Constructor.

Parameters:
li the listener object to deliver the event to
ev the event to be delivered

Definition at line 62 of file listener.hh.

template<class Listener, class Event>
virtual VUtil::ListenerTask< Listener, Event >::~ListenerTask (  )  [inline, virtual]

Destructor.

Definition at line 80 of file listener.hh.


Member Function Documentation

template<class Listener, class Event>
virtual void VUtil::ListenerTask< Listener, Event >::doTask (  )  [inline, virtual]

The actual task.

Because this is a generic template, we don't know ahead of time what method on the listener we actually want to call. So we call the method deliverTo() on the event, and pass it the listener object; this has event deliver itself to the listener by calling the appropriate method on the listener.

Implements VUtil::Task.

Definition at line 75 of file listener.hh.


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