TAPs 0.7.7.3
TAPsDebug.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsDebug.hpp
00003 ******************************************************************************/
00007 /******************************************************************************
00008 SUKITTI PUNAK   (08/27/2010)
00009 UPDATE          (12/03/2010)
00010 ******************************************************************************/
00011 #ifndef TAPs_DEBUG_HPP
00012 #define TAPs_DEBUG_HPP
00013 
00014 #include <cstdarg>
00015 #include "../Core/TAPsStdLib.hpp"
00016 
00017 BEGIN_NAMESPACE_TAPs
00018 //=============================================================================
00019 class Debug {
00020 //=============================================================================
00021 public:
00022     // Member Functions -------------------------------------------------------
00023 
00024 
00027     #define PrtNotImplementedYet( str ) std::cout << str << " -- File(" << __FILE__ << ") Line(" << __LINE__ << ") is NOT implemented yet!\n";
00028 
00030     #define PrtError( str ) std::cout << "Error: " << str << << "!" << std::endl;
00031 
00032     #define PrtErrorWithFileNameAndLineNumber( str ) std::cout << "Error: " << str << " -- File(" << __FILE__ << ") Line(" << __LINE__ << ")!" << std::endl;
00033 
00035     #define PrtWarning( str ) std::cout << "Warning: " << str << << "!" << std::endl;
00036 
00037     #define PrtWarningWithFileNameAndLineNumber( str ) std::cout << "Warning: " << str << " -- File(" << __FILE__ << ") Line(" << __LINE__ << ")!" << std::endl;
00038 
00039     // Data Members -----------------------------------------------------------
00040 //=============================================================================
00041 protected:
00042     // Member Functions -------------------------------------------------------
00043     // Data Members -----------------------------------------------------------
00044 //=============================================================================
00045 private:
00046     // Member Functions -------------------------------------------------------
00047     // Data Members -----------------------------------------------------------
00048 //=============================================================================
00049 
00050 
00051 //=============================================================================
00052 // OpenGL
00053 #if defined(__gl_h_) || defined(__GL_H__)
00054 //-----------------------------------------------------------------------------
00055 public:
00057     virtual void Draw () const;
00058 //-----------------------------------------------------------------------------
00059 #endif  // OpenGL
00060 //=============================================================================
00061 
00062 
00063 //=============================================================================
00064 }; // END CLASS Debug
00065 //=============================================================================
00066 
00067 
00068 
00069 //=============================================================================
00070 class LogMessage {
00071 //=============================================================================
00072 public:
00073     // Member Functions -------------------------------------------------------
00074 
00078     static void StdCout ( std::string const & str )
00079     {
00080         #if defined(TAPs_ENABLE_LOG_MESSAGE_FLUSH)
00081             std::cout << str << "\n";
00082         #elif defined(TAPs_ENABLE_LOG_MESSAGE)
00083             std::cout << str << std::endl;
00084         #else
00085         #endif
00086     }
00087 
00088     //*
00095     static void StdCout ( const char * types, ... )
00096     {
00097         std::stringstream ss;
00098 
00099         ss << "TEST StdCout ( const char * types, ... )";
00100 
00101         /*
00102         va_list vl;
00103         va_start( vl, types );
00104         for ( int i = 0; types[i] != '\0'; ++i ) {
00105             switch ( types[i] ) {
00106             case 'i':
00107                 ss << va_arg( vl, int );
00108                 break;
00109             case 'f':
00110                 ss << va_arg( vl, float );
00111                 break;
00112             case 'd':
00113                 ss << va_arg( vl, double );
00114                 break;
00115             case 'c':
00116                 ss << va_arg( vl, char );
00117                 break;
00118             case 's':
00119                 ss << va_arg( vl, char * );
00120                 break;
00121             default:
00122                 ss << "<unknown argument>";
00123                 break;
00124             }
00125         }
00126         va_end( vl );
00127         //*/
00128 
00129         #if defined(TAPs_ENABLE_LOG_MESSAGE_FLUSH)
00130             std::cout << ss.str() << "\n";
00131         #elif defined(TAPs_ENABLE_LOG_MESSAGE)
00132             std::cout << ss.str() << std::endl;
00133         #else
00134         #endif
00135     }
00136     //*/
00137 
00138     // Data Members -----------------------------------------------------------
00139 //=============================================================================
00140 protected:
00141     // Member Functions -------------------------------------------------------
00142     // Data Members -----------------------------------------------------------
00143 //=============================================================================
00144 private:
00145     // Member Functions -------------------------------------------------------
00146     // Data Members -----------------------------------------------------------
00147 //=============================================================================
00148 
00149 
00150 //=============================================================================
00151 // OpenGL
00152 #if defined(__gl_h_) || defined(__GL_H__)
00153 //-----------------------------------------------------------------------------
00154 public:
00156     virtual void Draw () const;
00157 //-----------------------------------------------------------------------------
00158 #endif  // OpenGL
00159 //=============================================================================
00160 
00161 
00162 //=============================================================================
00163 }; // END CLASS Debug
00164 //=============================================================================
00165 //=============================================================================
00166 END_NAMESPACE_TAPs
00167 //-----------------------------------------------------------------------------
00169 //#include "TAPsDebug.cpp"
00170 
00172 // Include definition if TAPs_USE_EXPORT is not defined
00173 //#if !defined( TAPs_USE_EXPORT )
00174 //  #include "TAPsDebug.cpp"
00175 //#endif
00176 //-----------------------------------------------------------------------------
00177 #endif
00178 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00179 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines