source: projectionDesigner/trunk/projdesigner/include/gmtl/Helpers.h @ 156

Last change on this file since 156 was 4, checked in by Torben Dannhauer, 15 years ago
File size: 2.0 KB
Line 
1/************************************************************** ggt-head beg
2 *
3 * GGT: Generic Graphics Toolkit
4 *
5 * Original Authors:
6 *   Allen Bierbaum
7 *
8 * -----------------------------------------------------------------
9 * File:          Helpers.h,v
10 * Date modified: 2004/09/16 19:40:35
11 * Version:       1.2
12 * -----------------------------------------------------------------
13 *
14 *********************************************************** ggt-head end */
15/*************************************************************** ggt-cpr beg
16*
17* GGT: The Generic Graphics Toolkit
18* Copyright (C) 2001,2002 Allen Bierbaum
19*
20* This library is free software; you can redistribute it and/or
21* modify it under the terms of the GNU Lesser General Public
22* License as published by the Free Software Foundation; either
23* version 2.1 of the License, or (at your option) any later version.
24*
25* This library is distributed in the hope that it will be useful,
26* but WITHOUT ANY WARRANTY; without even the implied warranty of
27* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28* Lesser General Public License for more details.
29*
30* You should have received a copy of the GNU Lesser General Public
31* License along with this library; if not, write to the Free Software
32* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33*
34 ************************************************************ ggt-cpr end */
35#ifndef _GMTL_HELPERS_H_
36#define _GMTL_HELPERS_H_
37
38#include <gmtl/Config.h>
39
40// Helper classes
41namespace gmtl
42{
43namespace helpers
44{
45
46struct ConstructorCounter
47{
48   unsigned mCount;
49
50   ConstructorCounter()
51   { mCount = 0; }
52
53   void inc()
54   { mCount += 1; }
55   unsigned get()
56   { return mCount; }
57};
58
59// Global version of the contructor counters
60//#ifdef GMTL_COUNT_CONSTRUCT_CALLS
61
62//ConstructorCounter VecConstructCounter;   // Counter for vec objects
63inline ConstructorCounter* VecCtrCounterInstance()
64{
65   static ConstructorCounter vec_counter;
66   return &vec_counter;
67}
68
69//#endif
70
71
72}
73}
74
75#endif
76
77
Note: See TracBrowser for help on using the repository browser.