eventq.hh (4437:b6e304245729) | eventq.hh (4471:4d86c4d096ad) |
---|---|
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: | 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, EventQueue *q = &mainEventQueue, | 296 EventWrapper(T *obj, bool del = false, 297 EventQueue *q = &mainEventQueue, |
297 Priority p = Default_Pri) 298 : Event(q, p), object(obj) 299 { 300 if (del) 301 setFlags(AutoDelete); 302 } | 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 |
|
303 void process() { (object->*F)(); } 304}; 305 306/* 307 * Queue of events sorted in time order 308 */ 309class EventQueue : public Serializable 310{ --- 141 unchanged lines hidden --- | 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 --- |