Smart pointer designed to maintain lifetime of objects with internal reference counting (ICommon degived classes). More...
#include <Object.h>
Public Member Functions | |
Constructors | |
| O () | |
| This constructor just creates an empty "null reference" that can be assinged later. | |
| O (T *address) | |
| O (const O< T > &rO) | |
| template<class T2 > | |
| O (const O< T2 > &rO) | |
Assignment Operators | |
| O< T > & | operator= (T *address) |
| O< T > & | operator= (const O< T > &rO) |
| template<class T2 > | |
| O< T > & | operator= (const O< T2 > &rO) |
Destructor | |
| virtual | ~O () |
| Regardless of how we obtained the object we are pointing to, we release it when we destuct. | |
Equality Checks | |
These equality checks are for use when two smart pointers are being compared. | |
| template<class T2 > | |
| bool | operator== (const O< T2 > &rO) |
| template<class T2 > | |
| bool | operator== (const O< T2 > &rO) const |
| template<class T2 > | |
| bool | operator!= (const O< T2 > &rO) |
| template<class T2 > | |
| bool | operator!= (const O< T2 > &rO) const |
| template<class T2 > | |
| bool | operator< (const O< T2 > &rO) |
| template<class T2 > | |
| bool | operator< (const O< T2 > &rO) const |
Testing for NULL | |
These equality checks are for use when comapring a smart pointer to raw pointer (this also handles comparing to NULL). | |
| bool | operator== (T *address) |
| bool | operator== (T *address) const |
| bool | operator!= (T *address) |
| bool | operator!= (T *address) const |
Member Access | |
This is how we allow access to the members of the object we are referencing. | |
| T * | operator-> () |
| T * | operator-> () const |
Friends | |
| template<class U > | |
| class | O |
| There are several cases below where we have templatized methods below that need access to _object between types of O. More... | |
| template<class V > | |
| class | Common |
Smart pointer designed to maintain lifetime of objects with internal reference counting (ICommon degived classes).
The following rules are applied to incrementing and decrementing reference counter:
There are several cases below where we have templatized methods below that need access to _object between types of O.
We can allow this by friending our main type.
1.8.4