summaryrefslogtreecommitdiff
path: root/ext/dsent/libutil/Config.h
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2014-10-11 15:02:23 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2014-10-11 15:02:23 -0500
commite8ed7b1d1b5bef31e9874f679a5797c2e00d06f1 (patch)
tree421c9c50377aa664958685914f5504c4c019e21f /ext/dsent/libutil/Config.h
parenta098fad174d8559037602b248b8e6f7f46bfebbb (diff)
downloadgem5-e8ed7b1d1b5bef31e9874f679a5797c2e00d06f1.tar.xz
ext: add the source code for DSENT
This patch adds a tool called DSENT to the ext/ directory. DSENT is a tool that models power and area for on-chip networks. The next patch adds a script for using the tool.
Diffstat (limited to 'ext/dsent/libutil/Config.h')
-rw-r--r--ext/dsent/libutil/Config.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/dsent/libutil/Config.h b/ext/dsent/libutil/Config.h
new file mode 100644
index 000000000..a60c4b8fd
--- /dev/null
+++ b/ext/dsent/libutil/Config.h
@@ -0,0 +1,37 @@
+#ifndef __LIBUTIL_CONFIG_H__
+#define __LIBUTIL_CONFIG_H__
+
+#include <iostream>
+
+#include "Map.h"
+
+namespace LibUtil
+{
+ class Config : public StringMap
+ {
+ public:
+ Config(const String& delimiter_ = "=", const String& comment_ = "#", const String& sentry_ = "End");
+ Config(const Config& config_);
+ virtual ~Config();
+
+ public:
+ // Make a copy of this instance
+ virtual Config* clone() const;
+ // Load the config from file
+ virtual void readFile(const String& filename_);
+ // Parse string and overwrite the Config instance if keys exist
+ virtual void readString(const String& str_);
+
+ // Write or read map using standard IO
+ friend std::ostream& operator<<(std::ostream& ost_, const Config& config_);
+ friend std::istream& operator>>(std::istream& ist_, Config& config_);
+
+ protected:
+ String mDelimiter;
+ String mComment;
+ String mSentry;
+ };
+}
+
+#endif // __LIBUTIL_CONFIG_H__
+