CMS 3D CMS Logo

OwnIt< T > Class Template Reference

a very very simple auto_ptr. More...

#include <SimG4Core/Notification/interface/OwnIt.h>

List of all members.

Public Types

typedef OwnIt< T > self

Public Member Functions

T * get () const
selfoperator= (T *p)
 OwnIt (T *p=0)
void reset ()
 ~OwnIt ()

Private Attributes

T * it


Detailed Description

template<class T>
class OwnIt< T >

a very very simple auto_ptr.

if static get destrying at the end avoiding fake memory leaks...

Definition at line 8 of file OwnIt.h.


Member Typedef Documentation

template<class T>
typedef OwnIt<T> OwnIt< T >::self

Definition at line 10 of file OwnIt.h.


Constructor & Destructor Documentation

template<class T>
OwnIt< T >::OwnIt ( T *  p = 0  )  [inline]

Definition at line 11 of file OwnIt.h.

00011 : it(p){}

template<class T>
OwnIt< T >::~OwnIt (  )  [inline]

Definition at line 13 of file OwnIt.h.

References OwnIt< T >::reset().

00013 { reset();}


Member Function Documentation

template<class T>
T* OwnIt< T >::get ( void   )  const [inline]

Definition at line 15 of file OwnIt.h.

References OwnIt< T >::it.

00015 { return it;}

template<class T>
self& OwnIt< T >::operator= ( T *  p  )  [inline]

Definition at line 14 of file OwnIt.h.

References OwnIt< T >::it.

00014 { if (it) delete it; it=p; return * this;}

template<class T>
void OwnIt< T >::reset ( void   )  [inline]

Definition at line 16 of file OwnIt.h.

References OwnIt< T >::it.

Referenced by OwnIt< T >::~OwnIt().

00016 { if (it) { delete it; it=0; } }


Member Data Documentation

template<class T>
T* OwnIt< T >::it [private]

Definition at line 19 of file OwnIt.h.

Referenced by OwnIt< T >::get(), OwnIt< T >::operator=(), and OwnIt< T >::reset().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:29:26 2009 for CMSSW by  doxygen 1.5.4