1/* 2 * Copyright (c) 2000-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 279 unchanged lines hidden (view full) --- 288 289template <class T, void (T::* F)()> 290class EventWrapper : public Event 291{ 292 private: 293 T *object; 294 295 public: |
296 EventWrapper(T *obj, bool del = false, 297 EventQueue *q = &mainEventQueue, |
298 Priority p = Default_Pri) 299 : Event(q, p), object(obj) 300 { 301 if (del) 302 setFlags(AutoDelete); 303 } |
304 305 EventWrapper(T *obj, Tick t, bool del = false, 306 EventQueue *q = &mainEventQueue, 307 Priority p = Default_Pri) 308 : Event(q, p), object(obj) 309 { 310 if (del) 311 setFlags(AutoDelete); 312 schedule(t); 313 } 314 |
315 void process() { (object->*F)(); } 316}; 317 318/* 319 * Queue of events sorted in time order 320 */ 321class EventQueue : public Serializable 322{ --- 141 unchanged lines hidden --- |