summaryrefslogtreecommitdiff
path: root/ext/dsent/libutil/LibUtil.h
diff options
context:
space:
mode:
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__
+