SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送
メインページ   名前空間一覧   クラス階層   構成   ファイル一覧   名前空間メンバ   構成メンバ   ファイルメンバ  

dkutilDebug.h

解説を見る。
00001 
00002 #include "dkutilTL.h"
00003 
00004 
00005 #ifndef __dkutilDebug_IncludeOnce__
00006 #define __dkutilDebug_IncludeOnce__
00007 
00008 
00009 namespace dkutil{
00010     namespace debug{
00011 
00012 
00013 //汎用デバックラッパー 
00014 class Cdebug{
00015 public:
00016     struct tugDebugFunc{
00017         tugDebugFunc(printfunc set=NULL) : setf(set){}
00018         printfunc setf;
00019     };
00020     typedef std::vector<tugDebugFunc> func;
00021 protected:
00022     DWORD printfuncnum;//プリントする関数の数
00023     func f;//function vector
00024     static HWND m_hWindow;//デバッグWindowのハンドル
00025 public:
00026     Cdebug(){
00027         printfuncnum=0;
00028         f.resize(20);//20個もあれば十分でしょうね^^
00029         FuncClear();//ファンクションアドレス配列を初期化する
00030     }
00031     virtual ~Cdebug(){}
00033     void SetFunc(printfunc get){
00034         f.push_back(tugDebugFunc(get));
00035     }
00037     void FuncClear(){
00038         f.clear();
00039         f.push_back(tugDebugFunc(dfDebugWindowPrint));
00040     }
00042     virtual bool printf(char *str,...){
00043         DWORD len = ::dkutil::DTL::GetKB<3>::value;
00044         char s[ ::dkutil::DTL::GetKB<3>::value ];
00045         SET_VA_LIST(s,len,str);
00046         tugDebugFunc *getfunc=NULL;
00047         for(func::iterator i=f.begin();i!=f.end();i++){
00048                 getfunc=&(*i);
00049                 if(getfunc!=NULL && (getfunc->setf) !=NULL)
00050                     getfunc->setf(s);
00051         }
00052         return true;
00053     }
00058     virtual int OpenWindow(int flag=NULL);
00060     virtual int CloseWindow( void );
00062     static int DebugWindowPrint(char *str,...);
00065     static int dfDebugWindowPrint(char *str);
00067     virtual int ClearWindow( void );
00069     inline int DebugWindowMessageLoopInfinity(){
00070         if(m_hWindow==NULL) return -1;
00071         MSG Message;
00072         BOOL Result=0;
00073         for(;;){
00074             Result=::GetMessage( &Message, NULL, 0, 0 );
00075             if(Result== -1){
00076                 return Result;
00077             }
00078             if(Result){
00079                 //dkutil::dOutputDebugString("mes ID = %d",Result);
00080                 switch(Result){
00081                 //case WM_CLOSE:
00082                 //  return Result;
00083                 case 1:
00084                 default:
00085                     
00086                     ::TranslateMessage( &Message );
00087                     ::DispatchMessage( &Message );
00088                     break;
00089                 }
00090             }else{
00091                 break;
00092             }
00093         }
00094         return 0;
00095     }
00099     virtual int ReflectWindow(DWORD GetMesCount);
00103     virtual int DebugWindowPrintRefrect(int FlagOrCount,char *str,...);
00104 };
00105 
00106 
00107 inline Cdebug *GetDebug(){
00108     static ::dkutil::DTL::dk_singleton<Cdebug> r;
00109     return r.get();
00110 }
00111 
00112 
00113 
00114 
00115 
00116 #ifdef USE_DKINGYO_OBJECT_TEST
00117 extern void debug_queue_test();
00118 extern void DebugWindowTestInfinity();
00119 #endif
00120     }//end of debug
00121 }//end of dkutil
00122 
00123 
00124 #endif // end of include once

dKingyoUtilClass (dkutil)に対してMon Jun 9 01:32:41 2003に生成されました。 doxygen1.3