VCF::EventHandler Class Reference
EventHandler's form the back bone of the event model in the VCF. More...
#include <vcf/FoundationKit/EventHandler.h>
Inheritance diagram for VCF::EventHandler:

Public Types | |
| typedef std::vector< EventHandler * > | Vector |
Public Member Functions | |
| EventHandler () | |
| virtual | ~EventHandler () |
| virtual void | invoke (Event *e)=0 |
| Called during the events dispatch cycle. | |
| virtual Object * | getSource () |
| Returns the source that the event handler is attached to. | |
| void | addHandlerToSource (Object *source, const String &handlerName) |
| Adds the EventHandler to it's source object. | |
| String | getHandlerName () |
Protected Member Functions | |
| String | getHandlerNameFromSource (Object *source) |
Detailed Description
EventHandler's form the back bone of the event model in the VCF.The EventHandler base class provides a clean way to invoke the class specific member function pointers in the derived EventHandlerInstance template class.
The EventHandler is an abstract class an cannot be created. Instead you need to derive your own custom class from it and implement the invoke() method. Typically you can just use one of the already provided class, either the StaticEventHandlerInstance for wrapping static (or "C" style functions), or the various template derived classes that wrap a classes member function.
Member Typedef Documentation
|
|
|
Constructor & Destructor Documentation
|
|
|
|
|
|
Member Function Documentation
|
||||||||||||
|
Adds the EventHandler to it's source object. For this to work the source must be derived from ObjectWithEvents. By adding the event handler to the source, the handler's memory will be cleaned up by the source when the source is destroyed. The EventHandler may be retreived at any time by calling the getEventHandler() method on the source (once again, assuming the source is derived from ObjectWithEvents).
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/FoundationKit/EventHandler.h
