Deleted Added
sdiff udiff text old ( 8232:b28d06a175be ) new ( 8581:56f97760eadd )
full compact
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;

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

144 protected:
145 /// Accessor for flags.
146 Flags
147 getFlags() const
148 {
149 return flags & PublicRead;
150 }
151
152 Flags
153 getFlags(Flags _flags) const
154 {
155 assert(_flags.noneSet(~PublicRead));
156 return flags.isSet(_flags);
157 }
158
159 Flags
160 allFlags(Flags _flags) const
161 {
162 assert(_flags.noneSet(~PublicRead));
163 return flags.allSet(_flags);
164 }
165
166 /// Accessor for flags.
167 void
168 setFlags(Flags _flags)
169 {
170 assert(_flags.noneSet(~PublicWrite));
171 flags.set(_flags);
172 }
173

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

242
243 /// Maximum priority
244 static const Priority Maximum_Pri = SCHAR_MAX;
245
246 /*
247 * Event constructor
248 * @param queue that the event gets scheduled on
249 */
250 Event(Priority p = Default_Pri)
251 : nextBin(NULL), nextInBin(NULL), _priority(p), flags(Initialized)
252 {
253#ifndef NDEBUG
254 instance = ++instanceCounter;
255 queue = NULL;
256#endif
257#ifdef EVENTQ_DEBUG
258 whenCreated = curTick();
259 whenScheduled = 0;
260#endif

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

401 * @todo this assert is a good bug catcher. I need to
402 * make it true again.
403 */
404 //assert(head->when() >= when && "event scheduled in the past");
405 serviceOne();
406 }
407 }
408
409 // default: process all events up to 'now' (curTick())
410 void serviceEvents() { serviceEvents(curTick()); }
411
412 // return true if no events are queued
413 bool empty() const { return head == NULL; }
414
415 void dump() const;
416
417 Tick nextEventTime() { return empty() ? curTick() : head->when(); }
418
419 bool debugVerify() const;
420
421#ifndef SWIG
422 virtual void serialize(std::ostream &os);
423 virtual void unserialize(Checkpoint *cp, const std::string &section);
424#endif
425};
426

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

554{
555 class DelayEvent : public Event
556 {
557 private:
558 T *object;
559
560 public:
561 DelayEvent(T *o)
562 : object(o)
563 { this->setFlags(AutoDelete); }
564 void process() { (object->*F)(); }
565 const char *description() const { return "delay"; }
566 };
567
568 eventq->schedule(new DelayEvent(object), when);
569}
570
571template <class T, void (T::* F)()>

--- 33 unchanged lines hidden ---