Advanced Strategic Command
basictypes.h
Go to the documentation of this file.
1 /*
2  This file is part of Advanced Strategic Command; http://www.asc-hq.de
3  Copyright (C) 1994-2010 Martin Bickel and Marc Schellenberger
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; see the file COPYING. If not, write to the
17  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  Boston, MA 02111-1307 USA
19 */
20 
21 #ifndef basictypes_H
22 #define basictypes_H
23 
24 #include <vector>
25 #include <list>
26 #include <bitset>
27 
29 template <class T> class PointerVector : public std::vector<T> {
30  public:
32  for ( typename std::vector<T>::iterator it = std::vector<T>::begin(); it!=std::vector<T>::end(); it++ )
33  delete *it;
34  };
35 };
36 
37 
39 template <class T> class PointerList : public std::list<T> {
40  public:
42  for ( typename std::list<T>::iterator it= std::list<T>::begin(); it!= std::list<T>::end(); it++ )
43  delete *it;
44  };
45 };
46 
47 
48 typedef std::bitset<64> BitSet;
49 
50 
51 #endif
A list that stores pointers, but deletes the objects (and not only the pointers) on destruction...
Definition: basictypes.h:39
A vector that stores pointers, but deletes the objects (and not only the pointers) on destruction...
Definition: basictypes.h:29
std::bitset< 64 > BitSet
Definition: basictypes.h:48