CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DeepCopyPointerByClone< T > Class Template Reference

#include <DeepCopyPointerByClone.h>

Public Member Functions

 DeepCopyPointerByClone ()
 
 DeepCopyPointerByClone (T *t)
 
 DeepCopyPointerByClone (const DeepCopyPointerByClone &other)
 
 operator bool () const
 to allow test like " if (p) {...}" More...
 
Toperator* ()
 
const Toperator* () const
 
Toperator-> ()
 
const Toperator-> () const
 
DeepCopyPointerByCloneoperator= (const DeepCopyPointerByClone &other)
 
bool operator== (const T *otherP) const
 to allow test like " if (p == &someT) {...}" More...
 
 ~DeepCopyPointerByClone ()
 

Private Attributes

TtheData
 

Detailed Description

template<class T>
class DeepCopyPointerByClone< T >

Same as DeepCopyPointer, except that it copies the object pointed to wsing the clone() virtual copy constructor.

Definition at line 11 of file DeepCopyPointerByClone.h.

Constructor & Destructor Documentation

template<class T>
DeepCopyPointerByClone< T >::~DeepCopyPointerByClone ( )
inline

Definition at line 14 of file DeepCopyPointerByClone.h.

template<class T>
DeepCopyPointerByClone< T >::DeepCopyPointerByClone ( )
inline

Definition at line 15 of file DeepCopyPointerByClone.h.

template<class T>
DeepCopyPointerByClone< T >::DeepCopyPointerByClone ( T t)
inline

Definition at line 17 of file DeepCopyPointerByClone.h.

17 : theData(t) {}
tuple t
Definition: tree.py:139
template<class T>
DeepCopyPointerByClone< T >::DeepCopyPointerByClone ( const DeepCopyPointerByClone< T > &  other)
inline

Definition at line 19 of file DeepCopyPointerByClone.h.

19  {
20  if (other.theData) theData = other->clone(); else theData = 0;
21  }

Member Function Documentation

template<class T>
DeepCopyPointerByClone< T >::operator bool ( ) const
inline

to allow test like " if (p) {...}"

Definition at line 53 of file DeepCopyPointerByClone.h.

53 { return theData != 0;}
template<class T>
T& DeepCopyPointerByClone< T >::operator* ( )
inline

Definition at line 46 of file DeepCopyPointerByClone.h.

template<class T>
const T& DeepCopyPointerByClone< T >::operator* ( ) const
inline

Definition at line 47 of file DeepCopyPointerByClone.h.

template<class T>
T* DeepCopyPointerByClone< T >::operator-> ( )
inline

Definition at line 49 of file DeepCopyPointerByClone.h.

template<class T>
const T* DeepCopyPointerByClone< T >::operator-> ( ) const
inline

Definition at line 50 of file DeepCopyPointerByClone.h.

template<class T>
DeepCopyPointerByClone& DeepCopyPointerByClone< T >::operator= ( const DeepCopyPointerByClone< T > &  other)
inline

Definition at line 24 of file DeepCopyPointerByClone.h.

24  {
25  if ( theData != other.theData) {
26  delete theData;
27  if (other.theData) theData = other->clone(); else theData = 0;
28  }
29  return *this;
30  }
template<class T>
bool DeepCopyPointerByClone< T >::operator== ( const T otherP) const
inline

to allow test like " if (p == &someT) {...}"

Definition at line 56 of file DeepCopyPointerByClone.h.

56 { return theData == otherP;}

Member Data Documentation

template<class T>
T* DeepCopyPointerByClone< T >::theData
private