Public Types | Public Member Functions | Private Attributes | Friends | List of all members
vbl_shared_pointer< T > Class Template Reference

Non-intrusive smart pointers. More...

#include <vbl_fwd.h>

Public Types

typedef T element_type
 
typedef vbl_shared_pointer< T > self
 
typedef vbl_shared_pointer_data data_t
 

Public Member Functions

 vbl_shared_pointer ()
 
 vbl_shared_pointer (T *p)
 
 vbl_shared_pointer (self const &that)
 
template<class U >
 vbl_shared_pointer (vbl_shared_pointer< U > const &that)
 Construct using smart pointer to derived class. More...
 
template<class U >
selfoperator= (vbl_shared_pointer< U > const &that)
 
selfoperator= (self const &that)
 
 ~vbl_shared_pointer ()
 
 operator bool () const
 
bool operator! () const
 
T const * operator-> () const
 
T * operator-> ()
 
T const & operator * () const
 
T & operator * ()
 
bool operator!= (self const &that) const
 
bool operator== (self const &that) const
 
bool operator< (self const &that) const
 
T * as_pointer () const
 
void up_ref () const
 
void down_ref () const
 

Private Attributes

T * pointer
 pointer to object. More...
 
data_tcount_data
 

Friends

template<class U >
class vbl_shared_pointer
 

Detailed Description

template<class T>
class vbl_shared_pointer< T >

Non-intrusive smart pointers.

If your compiler supports member templates, these pointers will also work with base classes and derived classes, so that they work very much like raw pointers. If you do this, make sure your destructors are virtual (as you'd need to do for raw pointers anyway).

Definition at line 20 of file vbl_fwd.h.

Member Typedef Documentation

◆ data_t

template<class T>
typedef vbl_shared_pointer_data vbl_shared_pointer< T >::data_t

Definition at line 42 of file vbl_shared_pointer.h.

◆ element_type

template<class T>
typedef T vbl_shared_pointer< T >::element_type

Definition at line 39 of file vbl_shared_pointer.h.

◆ self

template<class T>
typedef vbl_shared_pointer<T> vbl_shared_pointer< T >::self

Definition at line 40 of file vbl_shared_pointer.h.

Constructor & Destructor Documentation

◆ vbl_shared_pointer() [1/4]

template<class T>
vbl_shared_pointer< T >::vbl_shared_pointer ( )
inline

Definition at line 44 of file vbl_shared_pointer.h.

◆ vbl_shared_pointer() [2/4]

template<class T>
vbl_shared_pointer< T >::vbl_shared_pointer ( T *  p)
inlineexplicit

Definition at line 47 of file vbl_shared_pointer.h.

◆ vbl_shared_pointer() [3/4]

template<class T>
vbl_shared_pointer< T >::vbl_shared_pointer ( self const &  that)
inline

Definition at line 57 of file vbl_shared_pointer.h.

◆ vbl_shared_pointer() [4/4]

template<class T>
template<class U >
vbl_shared_pointer< T >::vbl_shared_pointer ( vbl_shared_pointer< U > const &  that)
inline

Construct using smart pointer to derived class.

Definition at line 68 of file vbl_shared_pointer.h.

◆ ~vbl_shared_pointer()

template<class T>
vbl_shared_pointer< T >::~vbl_shared_pointer ( )
inline

Definition at line 121 of file vbl_shared_pointer.h.

Member Function Documentation

◆ as_pointer()

template<class T>
T* vbl_shared_pointer< T >::as_pointer ( ) const
inline

Definition at line 152 of file vbl_shared_pointer.h.

◆ down_ref()

template<class T>
void vbl_shared_pointer< T >::down_ref ( ) const
inline

Definition at line 159 of file vbl_shared_pointer.h.

◆ operator *() [1/2]

template<class T>
T const& vbl_shared_pointer< T >::operator * ( ) const
inline

Definition at line 143 of file vbl_shared_pointer.h.

◆ operator *() [2/2]

template<class T>
T& vbl_shared_pointer< T >::operator * ( )
inline

Definition at line 144 of file vbl_shared_pointer.h.

◆ operator bool()

template<class T>
vbl_shared_pointer< T >::operator bool ( ) const
inlineexplicit

Definition at line 129 of file vbl_shared_pointer.h.

◆ operator!()

template<class T>
bool vbl_shared_pointer< T >::operator! ( ) const
inline

Definition at line 133 of file vbl_shared_pointer.h.

◆ operator!=()

template<class T>
bool vbl_shared_pointer< T >::operator!= ( self const &  that) const
inline

Definition at line 147 of file vbl_shared_pointer.h.

◆ operator->() [1/2]

template<class T>
T const* vbl_shared_pointer< T >::operator-> ( ) const
inline

Definition at line 138 of file vbl_shared_pointer.h.

◆ operator->() [2/2]

template<class T>
T* vbl_shared_pointer< T >::operator-> ( )
inline

Definition at line 139 of file vbl_shared_pointer.h.

◆ operator<()

template<class T>
bool vbl_shared_pointer< T >::operator< ( self const &  that) const
inline

Definition at line 149 of file vbl_shared_pointer.h.

◆ operator=() [1/2]

template<class T>
template<class U >
self& vbl_shared_pointer< T >::operator= ( vbl_shared_pointer< U > const &  that)
inline

Definition at line 76 of file vbl_shared_pointer.h.

◆ operator=() [2/2]

template<class T>
self& vbl_shared_pointer< T >::operator= ( self const &  that)
inline

Definition at line 113 of file vbl_shared_pointer.h.

◆ operator==()

template<class T>
bool vbl_shared_pointer< T >::operator== ( self const &  that) const
inline

Definition at line 148 of file vbl_shared_pointer.h.

◆ up_ref()

template<class T>
void vbl_shared_pointer< T >::up_ref ( ) const
inline

Definition at line 155 of file vbl_shared_pointer.h.

Friends And Related Function Documentation

◆ vbl_shared_pointer

template<class T>
template<class U >
friend class vbl_shared_pointer
friend

Definition at line 64 of file vbl_shared_pointer.h.

Member Data Documentation

◆ count_data

template<class T>
data_t* vbl_shared_pointer< T >::count_data
private

Definition at line 167 of file vbl_shared_pointer.h.

◆ pointer

template<class T>
T* vbl_shared_pointer< T >::pointer
private

pointer to object.

Definition at line 166 of file vbl_shared_pointer.h.


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