#include <autocloner.h>
Collaboration diagram for AutoCloner< T >:

Public Methods | |
| AutoCloner () | |
| Default constructor sets things to NULL. More... | |
| AutoCloner (T *t) | |
| Pass in a T* and this sets the pointer to it. More... | |
| AutoCloner (const AutoCloner< T > &o) | |
| The copy constructor calls the gets operator. More... | |
| AutoCloner< T > & | operator= (const T &t) |
| The gets operator clones T when a sole T is passed in. More... | |
| AutoCloner< T > & | operator= (const T *t) |
| When a T pointer is passed in it checks for nullity before calling Clone(). More... | |
| AutoCloner< T > & | operator= (const AutoCloner< T > &o) |
| The standard gets uses one of the other gets to clone the pointer. More... | |
| ~AutoCloner () | |
| Destructor kills this copy of T -- wow this seems like Jave. More... | |
| const T * | operator-> () const |
| Dereferences this. More... | |
| T * | operator-> () |
| Dereferences this. More... | |
| bool | IsNull () const |
| Checks if the pointer itself is null so that one may dereference safely. More... | |
| bool | NotNull () const |
| Inverse if isNull(). More... | |
Private Attributes | |
| T * | t |
| The actual pointer. More... | |
Requires class T to have a virtual Clone() function that will duplicate itself
|
|||||||||
|
Default constructor sets things to NULL.
00009 {t=NULL;}
|
|
||||||||||
|
Pass in a T* and this sets the pointer to it.
|
|
||||||||||
|
The copy constructor calls the gets operator.
00013 {*this = o;}
|
|
|||||||||
|
Destructor kills this copy of T -- wow this seems like Jave.
00031 {if (t) delete t;}
|
|
|||||||||
|
Checks if the pointer itself is null so that one may dereference safely.
00037 {return t==0;}
|
|
|||||||||
|
Inverse if isNull().
00039 {return !isNull();}
|
|
|||||||||
|
Dereferences this.
00035 {return t;}
|
|
|||||||||
|
Dereferences this.
00033 {return t;}
|
|
||||||||||
|
The standard gets uses one of the other gets to clone the pointer.
00027 {
00028 return *this = o.t;
00029 }
|
|
||||||||||
|
When a T pointer is passed in it checks for nullity before calling Clone().
|
|
||||||||||
|
The gets operator clones T when a sole T is passed in.
|
|
|||||
|
The actual pointer.
|
1.2.15