www.pudn.com > Gimcrack-v0.0051-Source.zip > debug.h


#ifndef _DEBUG_H_ 
#define _DEBUG_H_ 
 
#include "compinfo.h" 
#include  
#include "../singleton.h" 
#include "dbgconsole.h" 
 
class GcDebug : public Singleton 
{ 
public: 
	 
	 
	// Constructor / Destructor 
	GcDebug(); 
	~GcDebug(); 
 
	//enum MsgType { INFO, ERROR }; 
 
	void GetInfo(); 
	 
	void Report( char * string, ... ); 
	//void Report( MsgType type, char * string, ... ); 
	bool Log( char * string, ... );		// Open, write and close log file 
	 
 
	static void Allocated()			{ numAllocated++; } 
	static void Deallocated()		{ numDeallocated++; } 
	static void Memory(int mem)		{ memoryUsed += mem; } 
	static __int64 Memory()			{ return memoryUsed; } 
	GcDebugConsole * Console()		{ return m_debugConsole; } 
 
private: 
	static __int64			memoryUsed; 
	static unsigned int		numAllocated; 
	static unsigned int		numDeallocated; 
 
	char				fileName[255]; 
	GcCompchar			comp; 
	GcDebugConsole *	m_debugConsole; 
}; 
 
 
#endif