-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjectcounter.h
39 lines (30 loc) · 1015 Bytes
/
objectcounter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef OBJECTCOUNTER_H_
#define OBJECTCOUNTER_H_
#include <iostream>
class ObjectCounter {
public:
static void registerNode() { ++node; }
static void unregisterNode() { --node; }
static void registerVB() { ++virtualboard; }
static void unregisterVB() { --virtualboard; }
static void registerPoint() { ++point; }
static void unregisterPoint() { --point; }
static void registerCT() { ++chesstype; }
static void unregisterCT() { --chesstype; }
static void registerTypeTreeNode() { ++typetreeNode; }
static void unregisterTypeTreeNode() { --typetreeNode; }
static void printInfo() {
std::cout << "node: " << node
<< "\nvirtualboard: " << virtualboard
<< "\npoint: " << point
<< "\nchesstype: " << chesstype
<< "\ntypetree node: " << typetreeNode << std::endl;
}
// private:
static int node;
static int virtualboard;
static int point;
static int chesstype;
static int typetreeNode;
};
#endif // OBJECTCOUNTER_H_