summaryrefslogtreecommitdiff
path: root/sim/eventq.hh
diff options
context:
space:
mode:
authorAndrew Schultz <alschult@umich.edu>2003-10-31 17:32:04 -0500
committerAndrew Schultz <alschult@umich.edu>2003-10-31 17:32:04 -0500
commit2ab51fbcdb1d26d635875174eb23f60d6f9dc6bb (patch)
treea24dc79dca85e80ac7580a24a71299a939f07748 /sim/eventq.hh
parentb5fc3af142cfe71e6cb331dbed3b177193553a58 (diff)
downloadgem5-2ab51fbcdb1d26d635875174eb23f60d6f9dc6bb.tar.xz
Changed the naming of Serializeable derived objects. Serializeable no longer has
objName as a member, instead it has the pure virtual function name(). SimObject now has a objName member, and all classes derived directly from Serializeable have to implement a name() function (which now makes them unique by pointer value) cpu/simple_cpu/simple_cpu.cc: Change initialization of Event to get rid of Serializeable naming dev/etherlink.cc: dev/etherlink.hh: Seralizeable derived naming changes sim/eventq.cc: Serializeable derived naming changes, also changed serialization process so it doesn't need to use nameChildren sim/eventq.hh: Serializeable derived naming changes, remove constructor for specifying event name sim/serialize.cc: Serializeable derived naming changes, remove setName function and the child naming pass for serialization sim/serialize.hh: Serializeable derived naming changes, removed nameChildren, setName sim/sim_object.cc: sim/sim_object.hh: Serializeable derived naming changes --HG-- extra : convert_revision : 67bcc275b6c210f7049f98a1ad0d22e8f5596a63
Diffstat (limited to 'sim/eventq.hh')
-rw-r--r--sim/eventq.hh32
1 files changed, 11 insertions, 21 deletions
diff --git a/sim/eventq.hh b/sim/eventq.hh
index 11bfe3a4e..ddf4c3198 100644
--- a/sim/eventq.hh
+++ b/sim/eventq.hh
@@ -104,22 +104,7 @@ class Event : public Serializeable, public FastAlloc
* @param queue that the event gets scheduled on
*/
Event(EventQueue *q, int p = 0)
- : Serializeable(defaultName), queue(q), next(NULL),
- _priority(p), _flags(None),
-#if TRACING_ON
- when_created(curTick), when_scheduled(0),
-#endif
- annotated_value(0)
- {
- }
-
- /*
- * Event constructor
- * @param queue that the event gets scheduled on
- */
- Event(EventQueue *q, std::string _name, int p = 0)
- : Serializeable(_name), queue(q), next(NULL),
- _priority(p), _flags(None),
+ : queue(q), next(NULL), _priority(p), _flags(None),
#if TRACING_ON
when_created(curTick), when_scheduled(0),
#endif
@@ -129,6 +114,10 @@ class Event : public Serializeable, public FastAlloc
~Event() {}
+ virtual std::string name() const {
+ return csprintf("%s_%x", defaultName, (uintptr_t)this);
+ }
+
/// Determine if the current event is scheduled
bool scheduled() const { return getFlags(Scheduled); }
@@ -219,12 +208,12 @@ DelayFunction(Tick when, T *object)
*/
class EventQueue : public Serializeable
{
+ protected:
+ std::string objName;
+
private:
Event *head;
- // only used to hold value between nameChildren() and serialize()
- int numAutoSerializeEvents;
-
void insert(Event *event);
void remove(Event *event);
@@ -232,9 +221,11 @@ class EventQueue : public Serializeable
// constructor
EventQueue(const std::string &n)
- : Serializeable(n), head(NULL), numAutoSerializeEvents(-1)
+ : objName(n), head(NULL)
{}
+ virtual std::string name() const { return objName; }
+
// schedule the given event on this queue
void schedule(Event *ev);
void deschedule(Event *ev);
@@ -266,7 +257,6 @@ class EventQueue : public Serializeable
Tick nextEventTime() { return empty() ? curTick : head->when(); }
- virtual void nameChildren();
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);
};