HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_ShowCounts.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_ShowCounts.h ( UT Library, C++)
7  *
8  * COMMENTS: Some macros for defining counters. This file should never be
9  * included in a header for obvious reasons. Define SHOW_COUNTS
10  * before including the header.
11  */
12 
13 #ifndef __UT_ShowCounts__
14 #define __UT_ShowCounts__
15 
16 #if defined(SHOW_COUNTS) && UT_ASSERT_LEVEL > 0
17  #if !defined(UT_DEBUG)
18  #define UT_DEBUG 1
19  #include "UT_Counter.h"
20  #undef UT_DEBUG
21  #else
22  #include "UT_Counter.h"
23  #endif
24 
25  #define UT_COUNTER(name, label) static UT_Counter name(label);
26  #define UT_INC_COUNTER(name) name++;
27  #define UT_ADD_COUNTER(name, amount) name += amount;
28  #define UT_DEC_COUNTER(name) name--;
29 #else
30  #define UT_COUNTER(name, label)
31  #define UT_INC_COUNTER(name)
32  #define UT_ADD_COUNTER(name, amount)
33  #define UT_DEC_COUNTER(name)
34 #endif
35 #endif