diff options
Diffstat (limited to 'src/base/trace.hh')
-rw-r--r-- | src/base/trace.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/base/trace.hh b/src/base/trace.hh index dbeffdc8b..eb0ab9dae 100644 --- a/src/base/trace.hh +++ b/src/base/trace.hh @@ -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 |