• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

event_handler_base.h

Go to the documentation of this file.
00001 /*
00002    $Id: event_handler_base.h,v 1.4 2002/08/18 19:53:16 ksterker Exp $
00003 
00004    Copyright (C) 2000/2001/2002 Kai Sterker <kaisterker@linuxgames.com>
00005    Part of the Adonthell Project http://adonthell.linuxgames.com
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License.
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY.
00011 
00012    See the COPYING file for more details.
00013 */
00014 
00015 
00016 /**
00017  * @file   event_handler_base.h
00018  * @author Kai Sterker <kaisterker@linuxgames.com>
00019  * 
00020  * @brief  Declares the base class for event handlers.
00021  * 
00022  */
00023 
00024 #ifndef EVENT_HANDLER_BASE_H__
00025 #define EVENT_HANDLER_BASE_H__
00026 
00027 #include "event.h"
00028 
00029 /**
00030  * This is the base class for actual event handlers. It
00031  * keeps track of registered scripts, recieves triggered events
00032  * and executes scripts handling those events
00033  */ 
00034 class event_handler_base
00035 {
00036 public:
00037 
00038     /**
00039      * Destructor
00040      */
00041     virtual ~event_handler_base () {}
00042 
00043     /** 
00044      * Registers an %event.
00045      * 
00046      * @param ev pointer to the %event to register.
00047      */
00048     virtual void register_event (event* ev) = 0;
00049 
00050     /** 
00051      * Unregister an %event.
00052      * 
00053      * @param ev pointer to the %event to unregister.
00054      */
00055     virtual void remove_event (event* ev) = 0;
00056 
00057     /** 
00058      * Check if an %event corresponding to ev exists, and execute it. 
00059      * 
00060      * @param ev %event to raise.
00061      */
00062     virtual void raise_event (const event* ev) = 0;
00063 };
00064 
00065 #endif // EVENT_HANDLER_BASE_H__

Generated on Fri Mar 18 2011 for Adonthell by  doxygen 1.7.1