-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutoCounter.h
63 lines (63 loc) · 1.65 KB
/
AutoCounter.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//#ifndef AUTOCOUNTER_H
//#define AUTOCOUNTER_H
//#include <iostream>
//#include <set>
//#include<string>
//class AutoCounter{
// static int count;
// int id;
// class CleanupCheck{
// std::set<AutoCounter*>trace;
// public:
// void add(AutoCounter*ap){
// trace.insert(ap);
// }
// static std::set<AutoCounter*>::iterator a;
// static bool IsLink(){
// a=verifier.trace.begin();
// while (a!=verifier.trace.end())
// {
//
// std::cout<<(*a)->id<<"LNik id link id inkedf ididefnwdifwrngorfgvonrwgfnvoj"<<std::endl;
// a++;
// }
// return verifier.trace.size()==0?0:1;
// }
// void remove(AutoCounter*ap){
// trace.erase(ap);
// }
// ~CleanupCheck(){
// std::cout<<"~CleanupCheck()"<<std::endl;
// }
//
// };
// static CleanupCheck verifier;
// AutoCounter():id(count++){
// verifier.add(this);
// std::cout<<"created["<<id<<"]"<<std::endl;
// }
// AutoCounter(const AutoCounter& );
// void operator=(const AutoCounter&);
//public:
//static bool IsLeak(){
//
// return CleanupCheck::IsLink();
// }
// static AutoCounter* create(){
// return new AutoCounter();
// }
// ~AutoCounter(){
// std::cout<<"destroying ["<<id<<"]"<<std::endl;
// verifier.remove(this);
// }
// friend std::ostream &operator <<(std::ostream&os,const AutoCounter&ac){
// return os<<"AutoCounter "<<ac.id;
// }
// friend std::ostream &operator <<(std::ostream&os,const AutoCounter*ac){
// return os<<"AutoCounter "<<ac->id;
// }
//};
//int AutoCounter::count=0;
// AutoCounter::CleanupCheck AutoCounter::verifier ;
// std::set<AutoCounter*>::iterator AutoCounter::CleanupCheck::a=verifier.trace.begin();
//#endif