debugall.h
来自「基于SDL的图形化贪心算法演示,支持节点的拖放」· C头文件 代码 · 共 65 行
H
65 行
#ifndef ___DEBUGALL_H___
#define ___DEBUGALL_H___
#include <vector>
#include <string>
#include <map>
#include <iostream>
#include <typeinfo.h>
using namespace std;
class DebugInfo
{
public:
DebugInfo()
:count(0)
{}
string typeName;
int count;
};
static map< string, DebugInfo* > g_DebugInfoVector;
class ObjectBase
{
public:
ObjectBase( const type_info& info )
{
//debug
string name = string( info.name() );
DebugInfo* pInfo = NULL;
pInfo = g_DebugInfoVector[name];
if( pInfo )
pInfo->count++;
else
{
pInfo = new DebugInfo;
pInfo->count = 1;
pInfo->typeName = name;
g_DebugInfoVector.insert( make_pair( name, pInfo ) );
}
}
~ObjectBase()
{
}
};
static
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?