EventHandlerDelegate< T, E > Class Template Reference

An implementation of EventHandler that delegates to a method in an object. More...

#include <EventHandler.h++>

Inheritance diagram for EventHandlerDelegate< T, E >:

Inheritance graph
[legend]
Collaboration diagram for EventHandlerDelegate< T, E >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 EventHandlerDelegate (T *object, void(T::*func)(E))
 Construct a new EventHandlerDelegate for an object.
void operator() (Eevent)
 Function-call operator.

Protected Member Functions

void invoke (E event)
 Invoke the handler with an event.


Detailed Description

template<class T, class E>
class ccxx::EventHandlerDelegate< T, E >

An implementation of EventHandler that delegates to a method in an object.

The object can be thought of as a pointer to an event handler method that can be invoked as if it were a function; it allows an object to declare one or more event-handling methods to be used as callbacks.

Author:
Mark Lindner

Constructor & Destructor Documentation

EventHandlerDelegate ( T *  object,
void(T::*)(E)  func 
) [inline]

Construct a new EventHandlerDelegate for an object.

Parameters:
object The object.
func A member function (method) in the object which will serve as the event handler.


Member Function Documentation

void invoke ( event  )  [inline, protected, virtual]

Invoke the handler with an event.

Parameters:
event The event.

Implements EventHandler< E >.

void operator() ( event  )  [inline, inherited]

Function-call operator.

The method simply delegates to invoke().

Parameters:
event The event.


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

Generated on Sat Apr 17 23:03:08 2010 for libcommonc++ by  doxygen 1.5.9