Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

spucassert.h

Go to the documentation of this file.
00001 // SPUC - Signal processing using C++ - A DSP library
00002 /*---------------------------------------------------------------------------*
00003  *                                   IT++                                    *
00004  *---------------------------------------------------------------------------*
00005  * Copyright (c) 1995-2001 by Tony Ottosson, Thomas Eriksson, Pål Frenger,   *
00006  * Tobias Ringström, and Jonas Samuelsson.                                   *
00007  *                                                                           *
00008  * Permission to use, copy, modify, and distribute this software and its     *
00009  * documentation under the terms of the GNU General Public License is hereby *
00010  * granted. No representations are made about the suitability of this        *
00011  * software for any purpose. It is provided "as is" without expressed or     *
00012  * implied warranty. See the GNU General Public License for more details.    *
00013  *---------------------------------------------------------------------------*/
00014 
00025 #ifndef __itassert_h
00026 #define __itassert_h
00027 
00028 #include <iostream>
00029 #include <string>
00030 #include "spucconfig.h"
00031 namespace SPUC {
00032 //      using std::string;
00052 
00053  
00055 void it_assert_f(string ass, string msg, string file, int line);
00057 void it_error_f(string msg, string file, int line);
00059 void it_warning_f(string msg, string file, int line);
00060 
00062 void it_enable_exceptions(bool on);
00064 void it_enable_warnings();
00066 void it_disable_warnings();
00068 void it_redirect_warnings(ostream *warn_stream);
00069 
00070 #if ASSERT_LEVEL==0 // No tests
00071 #  define it_assert0(t,s) ((void)0)
00072 #  define it_assert1(t,s) ((void)0)
00073 #elif ASSERT_LEVEL==1 // Only some tests
00074 #  define it_assert0(t,s) ((void)0)
00075 #  define it_assert1(t,s) (void)((t) || (it_assert_f(#t,s,__FILE__,__LINE__),0))
00076 #else // Full tests
00077 
00078 #  define it_assert0(t,s) (void)((t) || (it_assert_f(#t,s,__FILE__,__LINE__),0))
00079 
00080 #  define it_assert1(t,s) (void)((t) || (it_assert_f(#t,s,__FILE__,__LINE__),0))
00081 #endif // ASSERT_LEVEL
00082 
00084 #define it_assert(t,s)   (void)((t) || (it_assert_f(#t,s,__FILE__,__LINE__),0))
00085 
00086 #define it_error_if(t,s) (void)((!(t)) || (it_error_f(s,__FILE__,__LINE__),0))
00087 
00088 #define it_error(s)      it_error_f(s,__FILE__,__LINE__)
00089 
00090 #define it_warning(s)    it_warning_f(s,__FILE__,__LINE__)
00091 
00093 } // namespace SPUC
00094 #endif // __itassert_h

Generated on Fri Sep 16 11:02:30 2005 for spuc by  doxygen 1.4.4