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, 94 IsExitEvent = 0x10 |
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 |
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(); } |
305 Event *serviceOne(); |
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 --- |