cpu: `Minor' in-order CPU model
[gem5.git] / src / base / trace.hh
index dbeffdc8be4981bd152f05dbdbd19dc66d58a8a4..eb0ab9daecd3c1ae4e45839778f2fca74d3c03ee 100644 (file)
@@ -72,6 +72,20 @@ struct StringWrap
 
 inline const std::string &name() { return Trace::DefaultName; }
 
+// Interface for things with names. (cf. SimObject but without other
+// functionality).  This is useful when using DPRINTF
+class Named
+{
+  protected:
+    const std::string _name;
+
+  public:
+    Named(const std::string &name_) : _name(name_) { }
+
+  public:
+    const std::string &name() const { return _name; }
+};
+
 //
 // DPRINTF is a debugging trace facility that allows one to
 // selectively enable tracing statements.  To use DPRINTF, there must