eventq.hh (2665:a124942bacb8) eventq.hh (2667:fe64b8353b1c)
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;

--- 76 unchanged lines hidden (view full) ---

85 char _flags;
86
87 protected:
88 enum Flags {
89 None = 0x0,
90 Squashed = 0x1,
91 Scheduled = 0x2,
92 AutoDelete = 0x4,
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;

--- 76 unchanged lines hidden (view full) ---

85 char _flags;
86
87 protected:
88 enum Flags {
89 None = 0x0,
90 Squashed = 0x1,
91 Scheduled = 0x2,
92 AutoDelete = 0x4,
93 AutoSerialize = 0x8
93 AutoSerialize = 0x8,
94 IsExitEvent = 0x10
94 };
95
96 bool getFlags(Flags f) const { return (_flags & f) == f; }
97 void setFlags(Flags f) { _flags |= f; }
98 void clearFlags(Flags f) { _flags &= ~f; }
99
100 protected:
101 EventQueue *theQueue() const { return queue; }

--- 107 unchanged lines hidden (view full) ---

209 unsigned annotation() { return annotated_value; }
210
211 /// Squash the current event
212 void squash() { setFlags(Squashed); }
213
214 /// Check whether the event is squashed
215 bool squashed() { return getFlags(Squashed); }
216
95 };
96
97 bool getFlags(Flags f) const { return (_flags & f) == f; }
98 void setFlags(Flags f) { _flags |= f; }
99 void clearFlags(Flags f) { _flags &= ~f; }
100
101 protected:
102 EventQueue *theQueue() const { return queue; }

--- 107 unchanged lines hidden (view full) ---

210 unsigned annotation() { return annotated_value; }
211
212 /// Squash the current event
213 void squash() { setFlags(Squashed); }
214
215 /// Check whether the event is squashed
216 bool squashed() { return getFlags(Squashed); }
217
218 /// See if this is a SimExitEvent (without resorting to RTTI)
219 bool isExitEvent() { return getFlags(IsExitEvent); }
220
217 /// Get the time that the event is scheduled
218 Tick when() const { return _when; }
219
220 /// Get the event priority
221 int priority() const { return _priority; }
222
223 struct priority_compare :
224 public std::binary_function<Event *, Event *, bool>

--- 68 unchanged lines hidden (view full) ---

293 virtual const std::string name() const { return objName; }
294
295 // schedule the given event on this queue
296 void schedule(Event *ev);
297 void deschedule(Event *ev);
298 void reschedule(Event *ev);
299
300 Tick nextTick() { return head->when(); }
221 /// Get the time that the event is scheduled
222 Tick when() const { return _when; }
223
224 /// Get the event priority
225 int priority() const { return _priority; }
226
227 struct priority_compare :
228 public std::binary_function<Event *, Event *, bool>

--- 68 unchanged lines hidden (view full) ---

297 virtual const std::string name() const { return objName; }
298
299 // schedule the given event on this queue
300 void schedule(Event *ev);
301 void deschedule(Event *ev);
302 void reschedule(Event *ev);
303
304 Tick nextTick() { return head->when(); }
301 void serviceOne();
305 Event *serviceOne();
302
303 // process all events up to the given timestamp. we inline a
304 // quick test to see if there are any events to process; if so,
305 // call the internal out-of-line version to process them all.
306 void serviceEvents(Tick when) {
307 while (!empty()) {
308 if (nextTick() > when)
309 break;

--- 101 unchanged lines hidden ---
306
307 // process all events up to the given timestamp. we inline a
308 // quick test to see if there are any events to process; if so,
309 // call the internal out-of-line version to process them all.
310 void serviceEvents(Tick when) {
311 while (!empty()) {
312 if (nextTick() > when)
313 break;

--- 101 unchanged lines hidden ---