| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

GiGaUtil::InstanceCounter< T > Class Template Reference

Static class used to instrument constructors and destructors to search for memory leaks. More...

#include <GiGaUtil.h>

List of all members.


Public Member Functions

long increment ()
long decrement ()
long count () const
 InstanceCounter ()
virtual ~InstanceCounter ()

Private Attributes

long m_count

Detailed Description

template<class T>
class GiGaUtil::InstanceCounter< T >

Static class used to instrument constructors and destructors to search for memory leaks.

Author:
Markus Frank
Date:
2002-07-17

Definition at line 160 of file GiGaUtil.h.


Constructor & Destructor Documentation

template<class T>
GiGaUtil::InstanceCounter< T >::InstanceCounter (  )  [inline]

Definition at line 166 of file GiGaUtil.h.

00166 : m_count(0) {};

template<class T>
virtual GiGaUtil::InstanceCounter< T >::~InstanceCounter (  )  [inline, virtual]

Definition at line 167 of file GiGaUtil.h.

00168     {
00169       if( 0 != m_count ) 
00170         {
00171           std::cout << "Number of objects of type: "
00172                     << System::typeinfoName(typeid(T))
00173                     << " created, but not destroyed:" 
00174                     << m_count
00175                     << std::endl;
00176         }
00177     };


Member Function Documentation

template<class T>
long GiGaUtil::InstanceCounter< T >::increment (  )  [inline]

Definition at line 163 of file GiGaUtil.h.

00163 { return ++m_count; }

template<class T>
long GiGaUtil::InstanceCounter< T >::decrement (  )  [inline]

Definition at line 164 of file GiGaUtil.h.

00164 { return --m_count; }

template<class T>
long GiGaUtil::InstanceCounter< T >::count (  )  const [inline]

Definition at line 165 of file GiGaUtil.h.

00165 { return   m_count; }


Member Data Documentation

template<class T>
long GiGaUtil::InstanceCounter< T >::m_count [private]

Definition at line 161 of file GiGaUtil.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:01:19 2011 for GiGa by doxygen 1.4.7