Removed unecessary constructor call at each return.
[gem5.git] / sim / sim_object.hh
index b1dd19475c446dbfb4cc8e4a17b1a568c1cf4c73..f4b316ebb7b284c12f389f74bc990f62494b5233 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003 The Regents of The University of Michigan
+ * Copyright (c) 2001-2004 The Regents of The University of Michigan
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include <iostream>
 
 #include "sim/serialize.hh"
+#include "sim/startup.hh"
 
 /*
  * Abstract superclass for simulation objects.  Represents things that
  * correspond to physical components and can be specified via the
  * config file (CPUs, caches, etc.).
  */
-class SimObject : public Serializable
+class SimObject : public Serializable, protected StartupCallback
 {
   protected:
     std::string objName;
@@ -65,7 +66,8 @@ class SimObject : public Serializable
 
     virtual const std::string name() const { return objName; }
 
-    // initialization pass of all objects.  Gets invoked by SimInit()
+    // initialization pass of all objects.
+    // Gets invoked after construction, before unserialize.
     virtual void init();
     static void initAll();
 
@@ -82,6 +84,16 @@ class SimObject : public Serializable
 
     // static: call nameOut() & serialize() on all SimObjects
     static void serializeAll(std::ostream &);
+
+#ifdef DEBUG
+  public:
+    bool doDebugBreak;
+    static void debugObjectBreak(const std::string &objs);
+#endif
+
+  public:
+    bool doRecordEvent;
+    void recordEvent(const std::string &stat);
 };
 
 #endif // __SIM_OBJECT_HH__