Advanced Strategic Command
memory-measurement.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  ***************************************************************************/
10 
11 #ifndef memorymeasurementH
12  #define memorymeasurementH
13 
14 #include <map>
15 #include "ascstring.h"
16 #include "itemrepository.h"
17 
18 
19 
21 
22  class Node {
23  public:
24  Node( const ASCString& name ) : usage(0) { this->name = name; };
25  ASCString name;
26  int usage;
28  void add( Node* n) { childs.push_back( n ); };
29 
30  int sum();
31  ASCString prettyPrint( int indent );
32  };
33 
34  Node root;
35 
36  template<class T>
37  Node* measure( ItemRepository<T>& repository );
38 
39 
40  public:
41  MemoryMeasurement() : root("root") {};
42 
43  void measureTypes();
44  void measure( GameMap* gamemap );
45  void measureIcons( );
47 
48 
49 
50  };
51 
52 
53 #endif
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
The map. THE central structure of ASC, which holds everything not globally available together...
Definition: gamemap.h:182