#include <smartptr.hh>
Public Types | |
| typedef X | element_type |
Public Member Functions | |
| SmartPtr () | |
| ~SmartPtr () | |
| SmartPtr (const SmartPtr &x) | |
| template<class Y> | |
| SmartPtr (const SmartPtr< Y > &y) | |
| SmartPtr (X *x) | |
| SmartPtr & | operator= (const SmartPtr &x) |
| template<class Y> | |
| SmartPtr & | operator= (const SmartPtr< Y > &y) |
| template<class Y> | |
| SmartPtr & | operator= (Y *y) |
| X & | operator* () const |
| X * | operator-> () const |
| X * | get () const |
| X * | release () |
| void | swap (SmartPtr &x) |
| void | clear () |
| bool | isNull () const |
pointer-like object that maintains a count for how many times an object is referenced, and only deletes the object when the last smart pointer to it is destroyed.
To make it possible to create smart pointers to objects of a class, the class must inherit from SmartPtrBase.
NB: SmartPtrBase must only be inherited from *once*, so derive virtually if it appears multiple times:
class MyClass : public virtual SmartPtrBase {
...
};There are no implicit conversions from/to the actual pointer.
| typedef X SmartPtr< X >::element_type |
| SmartPtr& SmartPtr< X >::operator= | ( | const SmartPtr< Y > & | y | ) | [inline] |
| X& SmartPtr< X >::operator* | ( | ) | const [inline] |
| X* SmartPtr< X >::operator-> | ( | ) | const [inline] |
| X* SmartPtr< X >::get | ( | ) | const [inline] |
| X* SmartPtr< X >::release | ( | ) | [inline] |
| void SmartPtr< X >::clear | ( | ) | [inline] |
| bool SmartPtr< X >::isNull | ( | ) | const [inline] |
Referenced by UrlMapping::insertNext().
1.5.6