LibUtil.h revision 10447:a465576671d4
1#ifndef __LIBUTIL_H__
2#define __LIBUTIL_H__
3
4#include <vector>
5
6#include "String.h"
7#include "Exception.h"
8#include "Assert.h"
9#include "Map.h"
10#include "Log.h"
11#include "Config.h"
12#include "MathUtil.h"
13
14namespace LibUtil
15{
16    template<class T> void clearPtrVector(std::vector<T*>* vec_)
17    {
18        for(typename std::vector<T*>::iterator it = vec_->begin(); it != vec_->end(); ++it)
19        {
20            T* temp_T = (*it);
21            delete temp_T;
22        }
23        vec_->clear();
24        return;
25    }
26
27    template<class T> void deletePtrVector(std::vector<T*>* vec_)
28    {
29        clearPtrVector<T>(vec_);
30        delete vec_;
31        return;
32    }
33
34} // namespace LibUtil
35
36#endif // __LIBUTIL_H__
37
38