CMS 3D CMS Logo

Public Member Functions | Private Attributes

DeepCopyPointerByClone< T > Class Template Reference

#include <DeepCopyPointerByClone.h>

List of all members.

Public Member Functions

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

{ delete theData;}
template<class T>
DeepCopyPointerByClone< T >::DeepCopyPointerByClone ( ) [inline]

Definition at line 15 of file DeepCopyPointerByClone.h.

: theData(0) {}
template<class T>
DeepCopyPointerByClone< T >::DeepCopyPointerByClone ( T t) [inline]

Definition at line 17 of file DeepCopyPointerByClone.h.

: theData(t) {}
template<class T>
DeepCopyPointerByClone< T >::DeepCopyPointerByClone ( const DeepCopyPointerByClone< T > &  other) [inline]

Definition at line 19 of file DeepCopyPointerByClone.h.

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

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.

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

Definition at line 46 of file DeepCopyPointerByClone.h.

{ return *theData;}
template<class T>
const T& DeepCopyPointerByClone< T >::operator* ( ) const [inline]

Definition at line 47 of file DeepCopyPointerByClone.h.

{ return *theData;}
template<class T>
const T* DeepCopyPointerByClone< T >::operator-> ( ) const [inline]

Definition at line 50 of file DeepCopyPointerByClone.h.

{ return theData;}
template<class T>
T* DeepCopyPointerByClone< T >::operator-> ( ) [inline]

Definition at line 49 of file DeepCopyPointerByClone.h.

{ return theData;}
template<class T>
DeepCopyPointerByClone& DeepCopyPointerByClone< T >::operator= ( const DeepCopyPointerByClone< T > &  other) [inline]

Definition at line 24 of file DeepCopyPointerByClone.h.

                                                                          {
    if ( theData != other.theData) {
      delete theData;
      if (other.theData) theData = other->clone(); else theData = 0;
    }
    return *this;
  }
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.

{ return theData == otherP;}

Member Data Documentation

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