SDL++
C++wrapperfortheSDLlibrary.

sdl::event::Listener< EventType, Handler > Class Template Reference

Listens for and handles an event. More...

#include <Listener.h>

Inheritance diagram for sdl::event::Listener< EventType, Handler >:
Collaboration diagram for sdl::event::Listener< EventType, Handler >:

List of all members.

Public Types

typedef void(Handler::* HandleFunc )(const EventType &event)
 The member function pointer to the Handler's handle function.

Public Member Functions

virtual bool operator== (const SDL_Event *event)
 Listener (Handler &h, HandleFunc func)
virtual ~Listener ()
virtual void operator() (const SDL_Event *event)

Detailed Description

template<class EventType, class Handler>
class sdl::event::Listener< EventType, Handler >

Listens for and handles an event.

Template Parameters:
EventTypeThe type of the event for which to listen.
HandlerThe Handler to handle the event.

Definition at line 67 of file Listener.h.


Member Typedef Documentation

template<class EventType , class Handler >
void(Handler::* sdl::event::Listener< EventType, Handler >::HandleFunc)(const EventType &event),

The member function pointer to the Handler's handle function.

Parameters:
eventThe event to handle.

Definition at line 75 of file Listener.h.


Constructor & Destructor Documentation

template<class EventType , class Handler >
sdl::event::Listener< EventType, Handler >::Listener ( Handler &  h,
HandleFunc  func 
) [inline]

Constructs a Listener for a Handler's handle function.

Parameters:
hThe Handler to handle the event.
funcThe Handler's handle function for the event.

Definition at line 94 of file Listener.h.

template<class EventType , class Handler >
virtual sdl::event::Listener< EventType, Handler >::~Listener ( ) [inline, virtual]

Destroys the Listener.

Definition at line 101 of file Listener.h.


Member Function Documentation

template<class EventType , class Handler >
virtual void sdl::event::Listener< EventType, Handler >::operator() ( const SDL_Event *  event) [inline, virtual]

Handles an event.

Parameters:
eventthe event to handle.

Implements sdl::event::basic_Listener.

Definition at line 109 of file Listener.h.

template<class EventType , class Handler >
virtual bool sdl::event::Listener< EventType, Handler >::operator== ( const SDL_Event *  event) [inline, virtual]

Determines if a Listener equates to an SDL_Event.

Parameters:
eventThe SDL_Event to check.
Returns:
True if the SDL_Event equates to the Listener, false otherwise.

Reimplemented from sdl::event::basic_Listener.

Definition at line 84 of file Listener.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs