jigdo API

SmartPtr< X > Class Template Reference

Smart pointer, i.e. More...

#include <smartptr.hh>

List of all members.


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)
SmartPtroperator= (const SmartPtr &x)
template<class Y>
SmartPtroperator= (const SmartPtr< Y > &y)
template<class Y>
SmartPtroperator= (Y *y)
X & operator* () const
X * operator-> () const
X * get () const
X * release ()
void swap (SmartPtr &x)
void clear ()
bool isNull () const

Detailed Description

template<class X>
class SmartPtr< X >

Smart pointer, i.e.

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.


Member Typedef Documentation

template<class X>
typedef X SmartPtr< X >::element_type


Constructor & Destructor Documentation

template<class X>
SmartPtr< X >::SmartPtr (  )  [inline]

template<class X>
SmartPtr< X >::~SmartPtr (  )  [inline]

template<class X>
SmartPtr< X >::SmartPtr ( const SmartPtr< X > &  x  )  [inline]

template<class X>
template<class Y>
SmartPtr< X >::SmartPtr ( const SmartPtr< Y > &  y  )  [inline]

template<class X>
SmartPtr< X >::SmartPtr ( X *  x  )  [inline, explicit]


Member Function Documentation

template<class X>
SmartPtr& SmartPtr< X >::operator= ( const SmartPtr< X > &  x  )  [inline]

template<class X>
template<class Y>
SmartPtr& SmartPtr< X >::operator= ( const SmartPtr< Y > &  y  )  [inline]

template<class X>
template<class Y>
SmartPtr& SmartPtr< X >::operator= ( Y *  y  )  [inline]

template<class X>
X& SmartPtr< X >::operator* (  )  const [inline]

template<class X>
X* SmartPtr< X >::operator-> (  )  const [inline]

template<class X>
X* SmartPtr< X >::release (  )  [inline]

template<class X>
void SmartPtr< X >::swap ( SmartPtr< X > &  x  )  [inline]

Referenced by swap().

template<class X>
void SmartPtr< X >::clear (  )  [inline]

template<class X>
bool SmartPtr< X >::isNull (  )  const [inline]

Referenced by UrlMapping::insertNext().


The documentation for this class was generated from the following file:

Generated on Tue Sep 23 14:27:43 2008 for jigdo by  doxygen 1.5.6