trace.h

Go to the documentation of this file.
00001 /* libthrowable - a C++ library to ease error handling and debugging
00002  *
00003  * Copyright (C) Matthias Langer 2006 <mlangc@gmx.at>
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 #ifndef H_LIBTHROWABLE_TRACE
00021 #define H_LIBTHROWABLE_TRACE
00022 #include <libthrowable/macros/unique_id.h>
00023 #include <libthrowable/macros/here.h>
00024 #include <libthrowable/trace_point.h>
00025 
00026 #ifndef LIBTHROWABLE_DISABLE_MACROS
00027 
00028 #ifdef LIBTHROWABLE_NDEBUG
00029 #define LIBTHROWABLE_NTRACE
00030 #endif //LIBTHROWABLE_NDEBUG
00031 
00032 #ifndef LIBTHROWABLE_NTRACE
00033 
00038 #define LIBTHROWABLE_TRACE() \
00039     libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE)
00040 
00048 #define LIBTHROWABLE_TRACE_MSG(message) \
00049     libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE, (message))
00050 
00069 #define LIBTHROWABLE_TRACE_VAR(variable) \
00070     libthrowable::TracePoint LIBTHROWABLE_UNIQUE_ID(LIBTHROWABLE_HERE, (variable), #variable)
00071 
00072 #else //#ifndef LIBTHROWABLE_NTRACE
00073 #define LIBTHROWABLE_TRACE() \
00074     do { } while(0)
00075 #define LIBTHROWABLE_TRACE_MSG(message) \
00076     do { } while(0)
00077 #define LIBTHROWABLE_TRACE_VAR(variable) \
00078     do { } while(0)
00079 
00080 #endif //LIBTHROWABLE_NTRACE
00081 #endif //LIBTHROWABLE_DISABLE_MACROS
00082 #endif //H_LIBTHROWABLE_TRACE

Generated on Wed Jan 9 18:07:17 2008 for libthrowable by  doxygen 1.5.4  Hosted on  SourceForge.net Logo