Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::StaticEventHandlerInstance< EVENT > Class Template Reference

StaticEventHandlerInstance's are used to provide a typesafe wrapper around a specific class's static function pointers, as opposed to method pointers (which take the implicit this pointer). More...

#include <vcf/FoundationKit/EventHandler.h>

Inheritance diagram for VCF::StaticEventHandlerInstance< EVENT >:

VCF::EventHandler VCF::Object List of all members.

Public Types

typedef void(* OnStaticEventHandlerMethod )(EVENT *e)

Public Member Functions

 StaticEventHandlerInstance (OnStaticEventHandlerMethod handlerMethod, Object *source=NULL, const String &handlerName="")
virtual ~StaticEventHandlerInstance ()
virtual void invoke (Event *e)
 Called during the events dispatch cycle.

Protected Attributes

OnStaticEventHandlerMethod handlerMethod_

Detailed Description

template<class EVENT>
class VCF::StaticEventHandlerInstance< EVENT >

StaticEventHandlerInstance's are used to provide a typesafe wrapper around a specific class's static function pointers, as opposed to method pointers (which take the implicit this pointer).

In addition, when they are created, if the source passed in is derived from VCF::ObjectWithEvents /em and the handler name is specified, then the handler will be maintained in a list by the source, and destroyed when the source is destroyed, freeing the creator of the handler from worrying about memory leaks.


Member Typedef Documentation

template<class EVENT>
typedef void(* VCF::StaticEventHandlerInstance< EVENT >::OnStaticEventHandlerMethod)(EVENT *e)
 


Constructor & Destructor Documentation

template<class EVENT>
VCF::StaticEventHandlerInstance< EVENT >::StaticEventHandlerInstance OnStaticEventHandlerMethod  handlerMethod,
Object source = NULL,
const String handlerName = ""
[inline]
 

template<class EVENT>
virtual VCF::StaticEventHandlerInstance< EVENT >::~StaticEventHandlerInstance  )  [inline, virtual]
 


Member Function Documentation

template<class EVENT>
virtual void VCF::StaticEventHandlerInstance< EVENT >::invoke Event e  )  [inline, virtual]
 

Called during the events dispatch cycle.

The implementation will end up calling the appropriate call back method.

Implements VCF::EventHandler.


Member Data Documentation

template<class EVENT>
OnStaticEventHandlerMethod VCF::StaticEventHandlerInstance< EVENT >::handlerMethod_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information