メインページ | ネームスペース一覧 | クラス階層 | 構成 | Directories | ファイル一覧 | ネームスペースメンバ | 構成メンバ | ファイルメンバ | 関連ページ

BaseDebug.h

説明を見る。
00001 #ifndef BASE_DEBUG_H
00002 #define BASE_DEBUG_H
00003 #include "Env.h"
00004 #include <stdarg.h>
00005 #include <iostream>
00006 
00007 /** @file BaseDebug.h デバッグ用ユーティリティークラス・関数の定義. */
00008 
00009 /** デバッグ用 printf 関数.
00010     @verbatim
00011     DPF("メッセージ:%s", msg);@endverbatim
00012     の様に使う.                            */
00013 #define DPF Spr::DebugPrintf::GetInstance()->FileLine(__FILE__, __LINE__)
00014 /** デバッグ用 出力ストリーム.
00015     @verbatim
00016     DSTR << "メッセージ:" << msg;@endverbatim
00017     の様に使う.                            */
00018 #define DSTR (Spr::DebugPrintf::GetInstance()->Stream())
00019 
00020 #include <assert.h>
00021 
00022 namespace Spr {
00023 
00024 class SPR_DLL DebugPrintf{
00025 public:
00026     static DebugPrintf* GetInstance();
00027     struct SPR_DLL PrintfFunc{
00028         const char* file;
00029         int line;
00030         PrintfFunc(const char* f, int l):file(f), line(l){}
00031         int SPR_CDECL operator() (const char*, ...);
00032     };
00033     PrintfFunc FileLine(const char* f=0, int l=-1){
00034         return PrintfFunc(f, l);
00035     }
00036     std::ostream& Stream();
00037     static void Set(void (*out)(const char*));
00038 };
00039 
00040 #if 0   //  プログラムの動作を詳細に報告させるなら 1
00041  #define TRACEALL DebugPrintf
00042 #else
00043  #define TRACEALL (void*)
00044 #endif
00045 
00046 #if defined(_DEBUG) && !defined(NO_DEBUG_EVAL)
00047  #define DEBUG_EVAL(x) x
00048 #else
00049  #define DEBUG_EVAL(x)
00050 #endif
00051 }   //  namespace Spr
00052 
00053 #endif

Springheadに対してSun Apr 16 01:57:49 2006に生成されました。  doxygen 1.4.1