summaryrefslogtreecommitdiff
path: root/ext/dsent/libutil/LibUtil.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/LibUtil.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/LibUtil.h')
-rw-r--r--ext/dsent/libutil/LibUtil.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/ext/dsent/libutil/LibUtil.h b/ext/dsent/libutil/LibUtil.h
new file mode 100644
index 000000000..12eb76fa0
--- /dev/null
+++ b/ext/dsent/libutil/LibUtil.h
@@ -0,0 +1,37 @@
+#ifndef __LIBUTIL_H__
+#define __LIBUTIL_H__
+
+#include <vector>
+
+#include "String.h"
+#include "Exception.h"
+#include "Assert.h"
+#include "Map.h"
+#include "Log.h"
+#include "Config.h"
+#include "MathUtil.h"
+
+namespace LibUtil
+{
+ template<class T> void clearPtrVector(std::vector<T*>* vec_)
+ {
+ for(typename std::vector<T*>::iterator it = vec_->begin(); it != vec_->end(); ++it)
+ {
+ T* temp_T = (*it);
+ delete temp_T;
+ }
+ vec_->clear();
+ return;
+ }
+
+ template<class T> void deletePtrVector(std::vector<T*>* vec_)
+ {
+ clearPtrVector<T>(vec_);
+ delete vec_;
+ return;
+ }
+
+} // namespace LibUtil
+
+#endif // __LIBUTIL_H__
+