00001 // GMTL is (C) Copyright 2001-2010 by Allen Bierbaum 00002 // Distributed under the GNU Lesser General Public License 2.1 with an 00003 // addendum covering inlined code. (See accompanying files LICENSE and 00004 // LICENSE.addendum or http://www.gnu.org/copyleft/lesser.txt) 00005 00006 #ifndef _GMTL_HELPERS_H_ 00007 #define _GMTL_HELPERS_H_ 00008 00009 #include <gmtl/Config.h> 00010 00011 // Helper classes 00012 namespace gmtl 00013 { 00014 namespace helpers 00015 { 00016 00017 struct ConstructorCounter 00018 { 00019 unsigned mCount; 00020 00021 ConstructorCounter() 00022 { mCount = 0; } 00023 00024 void inc() 00025 { mCount += 1; } 00026 unsigned get() 00027 { return mCount; } 00028 }; 00029 00030 // Global version of the contructor counters 00031 //#ifdef GMTL_COUNT_CONSTRUCT_CALLS 00032 00033 //ConstructorCounter VecConstructCounter; // Counter for vec objects 00034 inline ConstructorCounter* VecCtrCounterInstance() 00035 { 00036 static ConstructorCounter vec_counter; 00037 return &vec_counter; 00038 } 00039 00040 //#endif 00041 00042 00043 } 00044 } 00045 00046 #endif 00047 00048