Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

dev.hpp

Go to the documentation of this file.
00001 #if !defined(_DEV_HPP)
00002 #define _DEV_HPP
00003 //============================================================================= 
00004 //
00005 // XDFLengine library
00006 //
00007 //-----------------------------------------------------------------------------
00008 //  dev.hpp
00009 //----------------------------------------------------------------------------- 
00015 //_____________________________________________________________________________
00016 //
00017 //  Copyright (C) 2003 Guillaume Baurand. All Rights Reserved.
00018 //
00019 //  This file is part of the XDFLengine project.
00020 //
00021 //  The XDFLengine is free software; you can redistribute it and/or modify
00022 //  it under the terms of the GNU General Public License as published by
00023 //  the Free Software Foundation; either version 2 of the License, or
00024 //  (at your option) any later version.
00025 //
00026 //  This program is distributed in the hope that it will be useful,
00027 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00028 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00029 //  GNU General Public License for more details.
00030 //
00031 //  You should have received a copy of the GNU General Public License
00032 //  along with this program; if not, write to the Free Software
00033 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
00034 //  USA.
00035 //
00036 //  For more information, 
00037 //      contact  : guillaume@baurand.net 
00038 //      or visit : http://xdflengine.sourceforge.net
00039 //
00040 //=============================================================================
00041 
00042 #include "config/config.hpp"
00043 #include "config/commonincs.hpp"
00044 
00045 
00046 static FILE* m_logout;
00047 class XDFLENGINE_EXPORT logstream
00048 {
00049 private:
00050     
00051 public: 
00052     logstream();
00053     ~logstream();
00054     void log_set                ( const char* p_pszLogDest);
00055     FILE*                       log_get();
00056     logstream & operator<<      ( const char* cContent);
00057     logstream & operator<<      ( long lContent);
00058     void display_version        ( char* cLibTag, char* cLibName, char* cLibVersion, char* cLibComment);
00059     void display_version        ( char* cLibTag, char* cLibName, int iLibVersion, char* cLibComment);
00060 };
00061 
00062 static logstream logout;
00063 
00064 
00065 
00066 
00067 #if TRACE_DEBUG==1
00068     static logstream        traceout;
00069     #define DEBUG_INIT              debug_init();
00070     #define DEBUG_END               debug_end();
00071     #define DEBUG_FUNC(func)        debug_in(#func) ;   debug_startLogLine(" ") ; debug_indent()    ; traceout <<  ">>" << #func << "<<\n"; debug_out(#func);
00072     #define DEBUG_IN(func)          debug_in(#func) ;   debug_startLogLine(" ") ; debug_indent()    ; traceout <<  ">>" << #func << "\n"; debug_indent(1)  ; 
00073     #define DEBUG_OUT(func)                         debug_startLogLine(" ") ; debug_indent(-1)  ; debug_indent() ; traceout << "<<" << #func << "\n";debug_out(#func);   
00074     #define DEBUG_ECHO                              debug_startLogLine(" ") ; debug_indent()    ; traceout << "-"
00075     #define DEBUG_ERR                               debug_startLogLine("#") ; debug_indent()    ; traceout << "ERROR : "
00076     #define DEBUG_CREATE(obj)   debug_create(#obj); debug_startLogLine("+") ; debug_indent()    ; traceout << "(+)" << #obj << "\n";
00077     #define DEBUG_DEL(obj)                          debug_startLogLine("-") ; debug_indent()    ; traceout << "(-)" << #obj << "\n";debug_del(#obj);
00078     #define DEBUG_WRITE             traceout    
00079 #else
00080     #define DEBUG_INIT              debug_init();
00081     #define DEBUG_END               debug_end();
00082     #define DEBUG_FUNC(func)        //cerr << #func <<"\n";
00083     #define DEBUG_IN(func)          //cerr << #func <<"\n";
00084     #define DEBUG_OUT(func)         //cerr << "/" << #func <<"\n";
00085     #define DEBUG_FUNC_OUT(func)    //#func;
00086     #define DEBUG_ECHO              if(0) logout 
00087     #define DEBUG_ERR               if(0) logout
00088     #define DEBUG_WRITE             if(0) logout
00089     #define DEBUG_CREATE(obj)       //#obj;
00090     #define DEBUG_DEL(obj)          //#obj;
00091 #endif
00092 
00093 
00094 void XDFLENGINE_EXPORT debug_init();
00095 void XDFLENGINE_EXPORT debug_end();
00096 void XDFLENGINE_EXPORT debug_indent(int offset=0);
00097 void XDFLENGINE_EXPORT debug_startLogLine(const char* c);
00098 
00099 void XDFLENGINE_EXPORT debug_in(const char* func);
00100 void XDFLENGINE_EXPORT debug_out(const char* func);
00101 void XDFLENGINE_EXPORT debug_create(const char* obj);
00102 void XDFLENGINE_EXPORT debug_del(const char* obj);
00103 
00104 #endif
00105 

Generated on Sat Oct 4 13:19:58 2003 for XDFLengine by doxygen1.3-rc2