src/ActionScheduler.h

Go to the documentation of this file.
00001 #ifndef ACTIONSCHEDULER_H_
00002 #define ACTIONSCHEDULER_H_
00003 
00004 #include "Connection.h"
00005 #include "WorldModel.h"
00006 #include "Logger.h"
00007 
00008 #include <queue>
00009 
00010 extern Logger Log;
00011 
00012 using namespace std;
00013 
00017 struct scheduled_action {
00021         int cycle;
00022         
00026         void (*action_callback)(WorldModel*,ServerSettings*,PlayerSettings*, void*, int);
00027         
00031         void* params;
00032         
00036         int params_size;
00037         
00041         void (*cleanup_callback)(void*, int);
00042 };
00043 
00052 class ActionScheduler
00053 {
00054         WorldModel     *WM;        
00055         ServerSettings *SS;        
00056         PlayerSettings *PS;        
00058         queue<struct scheduled_action> scheduled_actions;
00059 protected:
00060         void doDispatchAction(struct scheduled_action *action);
00061         
00062 public:
00063         ActionScheduler(WorldModel* wm, ServerSettings *ss, PlayerSettings *ps);
00064         virtual ~ActionScheduler();
00065         
00071         void dispatchAction(int cycle);
00072         
00073         
00074         void scheduleAction(int cycle, void (*action_callback)(WorldModel*,ServerSettings*,PlayerSettings*, void*, int), 
00075                         void (*cleanup_callback)(void*, int), void* params, int params_size); 
00076 };
00077 
00078 #endif /*ACTIONSCHEDULER_H_*/

Generated on Thu Apr 26 22:45:26 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1