adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-commits] CVS: adonthell/src schedtest.cc,NONE,1.1.2.1 Makefil


From: Kai Sterker <address@hidden>
Subject: [Adonthell-commits] CVS: adonthell/src schedtest.cc,NONE,1.1.2.1 Makefile.am,1.80.2.27,1.80.2.28 event.h,1.25.2.2,1.25.2.3 event_handler.cc,1.1.2.3,1.1.2.4 event_handler.h,1.1.2.2,1.1.2.3 event_list.cc,1.1.2.2,1.1.2.3 event_list.h,1.1.2.2,1.1.2.3 gamedate.cc,1.1.2.3,1.1.2.4 gamedate.h,1.1.2.2,1.1.2.3 gametime.cc,1.10.2.2,1.10.2.3 gametime.h,1.11.2.2,1.11.2.3 py_base.i,1.1.2.2,1.1.2.3 py_object.cc,1.10.2.1,1.10.2.2 python_class.cc,1.5.2.4,1.5.2.5 time_event.h,1.1.2.4,1.1.2.5 time_event_handler.cc,1.1.2.2,1.1.2.3 time_event_handler.h,1.1.2.2,1.1.2.3
Date: Mon, 10 Jun 2002 09:15:07 -0400

Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv18319

Modified Files:
      Tag: Branch_road_to_0-4
        Makefile.am event.h event_handler.cc event_handler.h 
        event_list.cc event_list.h gamedate.cc gamedate.h gametime.cc 
        gametime.h py_base.i py_object.cc python_class.cc time_event.h 
        time_event_handler.cc time_event_handler.h 
Added Files:
      Tag: Branch_road_to_0-4
        schedtest.cc 
Log Message:
IMPROVED precision of gametime calculation
IMPROVED python error reporting
FINISHED event_handler
ADDED test for schedule and gametime stuff (not complete yet)


--- NEW FILE ---
#include <iostream.h>

#include "python_class.h"
#include "event_handler.h"
#include "input_manager.h"
#include "gametime.h"
#include "gamedate.h"
#include "schedule.h"
#include "screen.h"

extern "C"
{
    void initbasec (void);
}

// our global test scbedule
schedule myschedule;

// tell the program to quit
int quit = 0;

// update time and schedule
void mainloop ()
{
    while (!quit)
    {
        // perform operations to keep the game's speed constant
        gametime::update ();

        // update the internal clock
        gamedate::update ();

        // run the schedule
        for (int i = 0; i < gametime::frames_to_skip (); i++)
        {
            input_manager::update ();
            myschedule.update ();
        }
    }
}

// catch escape key
int escape_pushed (input_event *e)
{
    keyboard_event *ev = (keyboard_event *) e;

    if (ev->type() == keyboard_event::KEY_PUSHED &&
        ev->key () == keyboard_event::ESCAPE_KEY)
        quit = 1;

    return 0;
}

int main (int argc, char* argv[])
{
    // gfx
    screen::init ();
    screen::set_video_mode (640, 480);

    // python system
    python::init ();
    python::insert_path ("adontest");
    initbasec ();
    PyObject *module = python::import_module ("base");
    data::globals = PyModule_GetDict (module);

    // input system
    input_manager::init ();
    input_listener listener;
    input_manager::add (&listener);

    Functor1wRet<input_event *, int> ftor;
    ftor = makeFunctor (&ftor, &escape_pushed);
    listener.connect_function (input_event::KEYBOARD_EVENT, ftor);

    // event system
    event_handler::init ();

    // gametime system
    // (2 realtime minutes make approx. 1 gametime day)
    gametime::init (2);
    gametime::start_action ();

    cout << "A game minute takes " << gametime::minute () << " cycles" << endl;

    // a clock telling every hour
    time_event clock ("1h");
    clock.repeat ("1h");
    clock.set_script ("clock");
    event_handler::register_event (&clock);

    // mainloop
    mainloop ();

    // cleanup
    event_handler::cleanup ();
    input_manager::cleanup ();
    python::cleanup ();
    // screen::cleanup ();

    return 0;
}

Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Makefile.am,v
retrieving revision 1.80.2.27
retrieving revision 1.80.2.28
diff -C2 -r1.80.2.27 -r1.80.2.28
*** Makefile.am 8 Jun 2002 21:15:35 -0000       1.80.2.27
--- Makefile.am 10 Jun 2002 13:15:04 -0000      1.80.2.28
***************
*** 9,13 ****
  #moddata_DATA = adonthell.pyc
  
! bin_PROGRAMS = alextest joltest pytest
  
  EXTRA_DIST = .indent.pro prefs.l # py_adonthell.i adonthell.py
--- 9,13 ----
  #moddata_DATA = adonthell.pyc
  
! bin_PROGRAMS = alextest joltest pytest schedtest
  
  EXTRA_DIST = .indent.pro prefs.l # py_adonthell.i adonthell.py
***************
*** 25,29 ****
          event_list.cc \
          fileops.cc \
!       game.cc \
          gamedate.cc \
          gametime.cc \
--- 25,29 ----
          event_list.cc \
          fileops.cc \
!         game.cc \
          gamedate.cc \
          gametime.cc \
***************
*** 39,45 ****
          event.h \
          event_handler.h \
          event_list.h \
!       fileops.h \
!       game.h \
          gamedate.h \
          gametime.h \
--- 39,46 ----
          event.h \
          event_handler.h \
+         event_handler_base.h \
          event_list.h \
!         fileops.h \
!         game.h \
          gamedate.h \
          gametime.h \
***************
*** 47,51 ****
          schedule.h \
          storage.h \
!       str_hash.h \
          time_event.h \
          time_event_handler.h \
--- 48,52 ----
          schedule.h \
          storage.h \
!         str_hash.h \
          time_event.h \
          time_event_handler.h \
***************
*** 116,119 ****
--- 117,122 ----
  pytest_SOURCES = pytest.cc
  
+ schedtest_SOURCES = schedtest.cc
+ 
  joltest_LDADD = libgui.a libgfx.a libinput.a libbase.a $(libbase_LDADD) 
$(libgui_LDADD)
  
***************
*** 121,124 ****
--- 124,129 ----
  
  pytest_LDADD = libbase.a libpython.a libgfx.a libinput.a $(libbase_LDADD) 
$(libpython_LDADD)
+ 
+ schedtest_LDADD = libbase.a libpython.a libgfx.a libinput.a $(libbase_LDADD) 
$(libpython_LDADD)
  
  # Note: .py files are also built by this target.

Index: event.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/event.h,v
retrieving revision 1.25.2.2
retrieving revision 1.25.2.3
diff -C2 -r1.25.2.2 -r1.25.2.3
*** event.h     8 Jun 2002 21:15:35 -0000       1.25.2.2
--- event.h     10 Jun 2002 13:15:04 -0000      1.25.2.3
***************
*** 41,45 ****
      TIME_EVENT      = 2,            // Certain point in gametime reached
      ACTION_EVENT    = 3,            // Character "acts" on a square 
!     MAX_EVENT       = 4
  };
  
--- 41,45 ----
      TIME_EVENT      = 2,            // Certain point in gametime reached
      ACTION_EVENT    = 3,            // Character "acts" on a square 
!     MAX_EVENTS      = 4
  };
  

Index: event_handler.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/event_handler.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** event_handler.cc    8 Jun 2002 21:15:35 -0000       1.1.2.3
--- event_handler.cc    10 Jun 2002 13:15:04 -0000      1.1.2.4
***************
*** 22,59 ****
   */
   
- #include <algorithm>
  #include "event_handler.h"
  
! // Array with the registered events; each type of event is kept in
! // a vector of its own for faster access
! vector<event*> event_handler::handlers[MAX_EVENT];
! 
! // See whether a matching event is registered and execute the
! // according script(s) 
! void event_handler::raise_event (const event& e)
! {
!     vector<event*>::iterator i;
!     // Search through all registered events with the type of the raised event
!     for (i = handlers[e.type ()].begin (); i != handlers[e.type ()].end (); 
i++)
!         // Execute the script; pass recieved event on to get event data
!         if ((*i)->equals (e)) (*i)->execute (e); 
! }
! 
! 
! // Unregister an event
! void event_handler::remove_event (event *e)
  {
!     vector<event*>::iterator i;
! 
!     // Search for the event we want to remove
!     i = find (handlers[e->type ()].begin (), handlers[e->type ()].end (), e);
  
!     // found? -> get rid of it :)
!     if (i != handlers[e->type ()].end ()) handlers[e->type ()].erase(i);
  }
  
  // Register a event with it's script
! void event_handler::register_event (event *e)
  {
!     handlers[e->type ()].push_back (e);
  }
--- 22,55 ----
   */
   
  #include "event_handler.h"
+ #include "event_list.h"
+ #include "time_event.h"
+ #include "time_event_handler.h"
+ 
+ // Array with registered event handlers
+ event_handler_base* event_handler::Handler[MAX_EVENTS];
+ 
+ // functions that return newly instanciated events
+ // of a certain type
+ NEW_EVENT (time_event)
  
! // Initialize the game event system
! void event_handler::init ()
  {
!     // register event handlers
!     Handler[ENTER_EVENT] = NULL;
!     Handler[LEAVE_EVENT] = NULL;
!     Handler[ACTION_EVENT] = NULL;
!     Handler[TIME_EVENT] = new time_event_handler;
  
!     // register events
!     REGISTER_EVENT (TIME_EVENT, time_event)
  }
  
  // Register a event with it's script
! void event_handler::cleanup ()
  {
!     for (int i; i < MAX_EVENTS; i++)
!         if (Handler[i] != NULL)
!             delete Handler[i];
  }

Index: event_handler.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/event_handler.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** event_handler.h     7 Jun 2002 07:41:23 -0000       1.1.2.2
--- event_handler.h     10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 18,22 ****
   * @author Kai Sterker <address@hidden>
   * 
!  * @brief  Declares the event_handler class.
   * 
   */
--- 18,22 ----
   * @author Kai Sterker <address@hidden>
   * 
!  * @brief  Declares the event_handler class
   * 
   */
***************
*** 25,38 ****
  #define EVENT_HANDLER_H__
  
! #include <vector>
! #include "event.h"
  
  /**
!  * Keeps track of registered scripts, recieves triggered events 
!  * and executes scripts handling those events
!  */ 
  class event_handler
  {
  public:
      /** 
       * Registers an event.
--- 25,48 ----
  #define EVENT_HANDLER_H__
  
! #include "event_handler_base.h"
  
  /**
!  * It ensures global access to the individual %event handlers.
!  */
  class event_handler
  {
  public:
+     /**
+      * Instanciate the actual event handlers. Event handlers
+      * can be specific to a certain event, or take care of
+      * different events.
+      */
+     static void init ();
+ 
+     /**
+      * Delete the event handlers.
+      */
+     static void cleanup ();
+ 
      /** 
       * Registers an event.
***************
*** 40,51 ****
       * @param ev pointer to the event to register.
       */
!     static void register_event (event* ev);
  
      /** 
       * Unregister an event.
       * 
!      * @param event* pointer to the event to unregister.
       */
!     static void remove_event (event* ev);
  
      /** 
--- 50,67 ----
       * @param ev pointer to the event to register.
       */
!     static void register_event (event* ev)
!     {
!         Handler[ev->type ()]->register_event (ev);
!     }
  
      /** 
       * Unregister an event.
       * 
!      * @param ev pointer to the event to unregister.
       */
!     static void remove_event (event* ev)
!     {
!         Handler[ev->type ()]->remove_event (ev);
!     }
  
      /** 
***************
*** 54,64 ****
       * @param ev event to raise.
       */
!     static void raise_event (const event& ev);
!     
  private:
! #ifndef SWIG
!     // registered events storage
!     static vector<event*> handlers[MAX_EVENT];
! #endif
  };
  
--- 70,83 ----
       * @param ev event to raise.
       */
!     static void raise_event (const event& ev)
!     {
!         Handler[ev.type ()]->raise_event (ev);
!     }
! 
  private:
!     /**
!      * A list of the actual event handlers
!      */
!     static event_handler_base* Handler[MAX_EVENTS];
  };
  

Index: event_list.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/event_list.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** event_list.cc       8 Jun 2002 21:15:35 -0000       1.1.2.2
--- event_list.cc       10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 26,30 ****
   
  // Array with callbacks to return a newly instanciated event
! new_event event_list::instanciate_event[MAX_EVENT];
  
  // destructor
--- 26,30 ----
   
  // Array with callbacks to return a newly instanciated event
! new_event event_list::instanciate_event[MAX_EVENTS];
  
  // destructor
***************
*** 58,62 ****
  void event_list::register_event (u_int8 type, new_event e)
  {
!     if (type < MAX_EVENT)
          instanciate_event[type] = e;
  }
--- 58,62 ----
  void event_list::register_event (u_int8 type, new_event e)
  {
!     if (type < MAX_EVENTS)
          instanciate_event[type] = e;
  }
***************
*** 88,92 ****
          
          // Instanciate an event of the given type
!         if (type < MAX_EVENT && instanciate_event[type] != NULL)
              e = instanciate_event[type]();
   
--- 88,92 ----
          
          // Instanciate an event of the given type
!         if (type < MAX_EVENTS && instanciate_event[type] != NULL)
              e = instanciate_event[type]();
   

Index: event_list.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/event_list.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** event_list.h        8 Jun 2002 21:15:35 -0000       1.1.2.2
--- event_list.h        10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 29,32 ****
--- 29,33 ----
  #include "event.h"
  
+ #ifndef SWIG
  /**
   * Pointer to a function returning a newly allocated %event
***************
*** 34,37 ****
--- 35,39 ----
  typedef event* (*new_event)();
  
+ #endif // SWIG
  
  /**
***************
*** 112,116 ****
       * The event's type is the postion of the according callback in the array.
       */
!     static new_event instanciate_event[MAX_EVENT];
  #endif // SWIG
  };
--- 114,118 ----
       * The event's type is the postion of the according callback in the array.
       */
!     static new_event instanciate_event[MAX_EVENTS];
  #endif // SWIG
  };
***************
*** 118,126 ****
  #ifndef SWIG
  /**
-  * A function that returns a new instance of an event.
-  */
- #define NEW_EVENT(evt)\
-     event* new_ ## evt () { return (event*) new evt; }
- /**
   * Registers an event with the event_list, allowing it to load this event
   * without knowing about it at compile time.
--- 120,123 ----
***************
*** 129,133 ****
      event_list::register_event (type, (new_event) &new_ ## evt);
  
! #endif // SWIG
  
  #endif // EVENT_LIST_H__
--- 126,135 ----
      event_list::register_event (type, (new_event) &new_ ## evt);
  
! /**
!  * A function that returns a new instance of an event.
!  */
! #define NEW_EVENT(evt)\
!     event* new_ ## evt () { return (event*) new evt; }
  
+ #endif // SWIG
  #endif // EVENT_LIST_H__

Index: gamedate.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/gamedate.cc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -r1.1.2.3 -r1.1.2.4
*** gamedate.cc 7 Jun 2002 07:41:23 -0000       1.1.2.3
--- gamedate.cc 10 Jun 2002 13:15:04 -0000      1.1.2.4
***************
*** 29,33 ****
  
  // number of game cycles since the last gametime minute passed
! u_int32 gamedate::Ticks = 0;
  
  // Increase gametime 
--- 29,33 ----
  
  // number of game cycles since the last gametime minute passed
! float gamedate::Ticks = 0.0;
  
  // Increase gametime 
***************
*** 39,43 ****
  
      // check whether a in-game minute has passed
!     if (Ticks >= gametime::minute ())
      {
          Ticks -= gametime::minute ();
--- 39,43 ----
  
      // check whether a in-game minute has passed
!     while (Ticks >= gametime::minute ())
      {
          Ticks -= gametime::minute ();

Index: gamedate.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/gamedate.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** gamedate.h  8 Jun 2002 21:15:35 -0000       1.1.2.2
--- gamedate.h  10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 100,104 ****
  
      // number of game cycles since the last gametime minute passed
!     static u_int32 Ticks;
  #endif // SWIG
  };
--- 100,104 ----
  
      // number of game cycles since the last gametime minute passed
!     static float Ticks;
  #endif // SWIG
  };

Index: gametime.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gametime.cc,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -C2 -r1.10.2.2 -r1.10.2.3
*** gametime.cc 5 May 2002 19:50:14 -0000       1.10.2.2
--- gametime.cc 10 Jun 2002 13:15:04 -0000      1.10.2.3
***************
*** 23,27 ****
  #include <SDL/SDL.h>
  
! u_int32 gametime::Minute;
  u_int32 gametime::timer1;
  u_int32 gametime::timer2;
--- 23,27 ----
  #include <SDL/SDL.h>
  
! float gametime::Minute;
  u_int32 gametime::timer1;
  u_int32 gametime::timer2;
***************
*** 39,43 ****
      
      // Number of game cycles during rt_minutes realtime minutes
!     u_int32 cycles = (1000 * rt_minutes) / CYCLE_LENGTH;
      
      // Calculate how many game cycles make one gametime minute,
--- 39,43 ----
      
      // Number of game cycles during rt_minutes realtime minutes
!     float cycles = (60000 * rt_minutes) / (float) CYCLE_LENGTH;
      
      // Calculate how many game cycles make one gametime minute,

Index: gametime.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gametime.h,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -C2 -r1.11.2.2 -r1.11.2.3
*** gametime.h  5 May 2002 19:50:14 -0000       1.11.2.2
--- gametime.h  10 Jun 2002 13:15:04 -0000      1.11.2.3
***************
*** 76,80 ****
       * @return %gametime in minutes.
       */
!     static u_int32 minute ()
      {
          return Minute;
--- 76,80 ----
       * @return %gametime in minutes.
       */
!     static float minute ()
      {
          return Minute;
***************
*** 134,138 ****
  #ifndef SWIG
      // One minute of gametime in game cycles
!     static u_int32 Minute;
  
      static bool running; 
--- 134,138 ----
  #ifndef SWIG
      // One minute of gametime in game cycles
!     static float Minute;
  
      static bool running; 

Index: py_base.i
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/py_base.i,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** py_base.i   8 Jun 2002 21:15:35 -0000       1.1.2.2
--- py_base.i   10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 5,9 ****
--- 5,11 ----
  #include "types.h"
  #include "game.h"
+ #include "event.h"
  #include "fileops.h"
+ #include "gamedate.h"
  #include "gametime.h"
  #include "schedule.h"
***************
*** 13,18 ****
--- 15,22 ----
  %include "py_wrappers_base.i"
  
+ %include "event.h"
  %include "game.h"
  %include "fileops.h"
  %include "gametime.h"
+ %include "gamedate.h"
  %include "schedule.h"

Index: py_object.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/py_object.cc,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -C2 -r1.10.2.1 -r1.10.2.2
*** py_object.cc        8 Jun 2002 21:15:35 -0000       1.10.2.1
--- py_object.cc        10 Jun 2002 13:15:04 -0000      1.10.2.2
***************
*** 88,97 ****
      PyObject * classobj = PyObject_GetAttrString (module, (char *) 
classname.c_str ());
      Py_DECREF (module);
!     if (!classobj) return false;
  
      // Create the instance
      Instance = PyObject_CallObject (classobj, args);
      Py_DECREF (classobj);
!     if (!Instance) return false;
  
      Classname = classname;
--- 88,105 ----
      PyObject * classobj = PyObject_GetAttrString (module, (char *) 
classname.c_str ());
      Py_DECREF (module);
!     if (!classobj)
!     {
!         python::show_traceback ();
!         return false;
!     }
  
      // Create the instance
      Instance = PyObject_CallObject (classobj, args);
      Py_DECREF (classobj);
!     if (!Instance)
!     {
!         python::show_traceback ();
!         return false;
!     }
  
      Classname = classname;

Index: python_class.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/python_class.cc,v
retrieving revision 1.5.2.4
retrieving revision 1.5.2.5
diff -C2 -r1.5.2.4 -r1.5.2.5
*** python_class.cc     8 Jun 2002 21:15:35 -0000       1.5.2.4
--- python_class.cc     10 Jun 2002 13:15:04 -0000      1.5.2.5
***************
*** 98,109 ****
  }
  
! /* Import a module, return module ptr */
  PyObject *python::import_module (string filename)
  {
      PyObject *result = PyImport_ImportModule ((char *) filename.c_str ());
!     
! #ifdef PY_DEBUG
!     show_traceback ();
! #endif
      return result;
  }
--- 98,108 ----
  }
  
! // Import a module, return module ptr
  PyObject *python::import_module (string filename)
  {
      PyObject *result = PyImport_ImportModule ((char *) filename.c_str ());
! 
!     if (result == NULL) show_traceback ();
! 
      return result;
  }

Index: time_event.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/time_event.h,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -r1.1.2.4 -r1.1.2.5
*** time_event.h        8 Jun 2002 21:15:35 -0000       1.1.2.4
--- time_event.h        10 Jun 2002 13:15:04 -0000      1.1.2.5
***************
*** 100,104 ****
      {
          time_event e = (time_event &) evnt;
!         return Time == e.time ();
      }
      
--- 100,104 ----
      {
          time_event e = (time_event &) evnt;
!         return Time <= e.time ();
      }
      

Index: time_event_handler.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/time_event_handler.cc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** time_event_handler.cc       8 Jun 2002 21:15:35 -0000       1.1.2.2
--- time_event_handler.cc       10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 21,30 ****
  
  #include <algorithm>
- #include "time_event_handler.h"
  #include "time_event.h"
  
  // See whether a matching event is registered and execute the
  // according script(s) 
! void time_event_handler::raise_event (event& e)
  {
      // no time event registered
--- 21,32 ----
  
  #include <algorithm>
  #include "time_event.h"
+ #include "time_event_handler.h"
+ 
+ // function returning a new time event
  
  // See whether a matching event is registered and execute the
  // according script(s) 
! void time_event_handler::raise_event (const event& e)
  {
      // no time event registered

Index: time_event_handler.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Attic/time_event_handler.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -r1.1.2.2 -r1.1.2.3
*** time_event_handler.h        8 Jun 2002 21:15:35 -0000       1.1.2.2
--- time_event_handler.h        10 Jun 2002 13:15:04 -0000      1.1.2.3
***************
*** 24,28 ****
  
  #include <vector>
! #include "event.h"
  
  using std::vector;
--- 24,28 ----
  
  #include <vector>
! #include "event_handler_base.h"
  
  using std::vector;
***************
*** 34,38 ****
   * comparison decides upon whether an %event is to be raised.
   */
! class time_event_handler
  {
  public:
--- 34,38 ----
   * comparison decides upon whether an %event is to be raised.
   */
! class time_event_handler : public event_handler_base
  {
  public:
***************
*** 63,67 ****
       *      minutes.
       */
!     void raise_event (event &evnt);
      
  private:
--- 63,67 ----
       *      minutes.
       */
!     void raise_event (const event &evnt);
      
  private:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]