Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cPtrTrace.h
Go to the documentation of this file.
1 //
5 //
6 
7 #ifndef _INC_cPtrTrace_H
8 #define _INC_cPtrTrace_H
9 #ifndef NO_PRAGMA_ONCE
10 #pragma once
11 #endif
12 
13 #include "PtrCast.h"
14 #include "cDebugAssert.h"
15 #include "cTypeInfo.h"
16 #include "cUnitTestDecl.h"
17 
18 namespace Gray
19 {
21  {
26 
27  public:
28  const char* m_pszType;
30 
31  static bool sm_bActive;
32 
33  public:
34  cPtrTrace(const TYPEINFO_t& TypeInfo) noexcept
35  : m_pszType(TypeInfo.name())
36  {
37  }
38  cPtrTrace(const cPtrTrace& ref) noexcept
39  : m_pszType(ref.m_pszType), m_Src(ref.m_Src)
40  {
41  // copy constructor.
42  }
43 
44  void TraceOpen(void* p);
45  void TraceClose(void* p);
46 
48  };
49 }
50 
51 #endif
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: cPtrTrace.h:21
const char * m_pszType
from __typeof(TYPEINFO_t).name()
Definition: cPtrTrace.h:28
static bool sm_bActive
Turn on/off tracing via cPtrTraceMgr. be fast.
Definition: cPtrTrace.h:31
cPtrTrace(const TYPEINFO_t &TypeInfo) noexcept
Definition: cPtrTrace.h:34
cDebugSourceLine m_Src
where (in code) was m_p set?
Definition: cPtrTrace.h:29
cPtrTrace(const cPtrTrace &ref) noexcept
Definition: cPtrTrace.h:38
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
std::type_info TYPEINFO_t
Definition: cTypeInfo.h:29
Definition: cDebugAssert.h:29