knowL: Knowledge Libraries
Loading...
Searching...
No Matches
MemoryLeakTracker.h
1#pragma once
2
3#include "Global.h"
4
5namespace knowCore
6{
7
17 {
18 public:
21 static MemoryLeakTracker* instance();
22 void reference(const void* what, const void* bywho, const char* whatName = 0);
23 void dereference(const void* what, const void* bywho);
24 void dumpReferences();
25 void dumpReferences(const void* what);
26 public:
27 template<typename _T_>
28 void reference(const _T_* what, const void* bywho);
29 template<typename _T_>
30 void dereference(const _T_* what, const void* bywho);
31 private:
32 struct Private;
33 Private* const d;
34 };
35
36#include <typeinfo>
37
38 template<typename _T_>
39 void MemoryLeakTracker::reference(const _T_* what, const void* bywho)
40 {
41 reference((void*)what, bywho, qPrintable(prettyTypename<_T_>()));
42 }
43
44 template<typename _T_>
45 void MemoryLeakTracker::dereference(const _T_* what, const void* bywho)
46 {
47 dereference((void*)what, bywho);
48 }
49}
Definition MemoryLeakTracker.h:17