WvStreams
Classes | Public Member Functions | List of all members
xplc_ptr< T > Class Template Reference

Smart pointer class for XPLC interfaces. More...

#include <ptr.h>

Inheritance diagram for xplc_ptr< T >:
Inheritance graph
[legend]

Public Member Functions

 xplc_ptr (T *aObj)
 Construct an xplc_ptr from a raw pointer.
 
template<class P >
 xplc_ptr (const xplc_ptr< P > &aObj)
 Construct an xplc_ptr from another xplc_ptr.
 
ProtectedPtr * operator-> () const
 Provide an operator->.
 
 operator ProtectedPtr * () const
 Provide an operator*.
 
xplc_ptroperator= (T *_ptr)
 Assign a raw pointer to an xplc_ptr.
 
 xplc_ptr (T *aObj)
 Construct an xplc_ptr from a raw pointer.
 
template<class P >
 xplc_ptr (const xplc_ptr< P > &aObj)
 Construct an xplc_ptr from another xplc_ptr.
 
ProtectedPtr * operator-> () const
 Provide an operator->.
 
 operator ProtectedPtr * () const
 Provide an operator*.
 
xplc_ptroperator= (T *_ptr)
 Assign a raw pointer to an xplc_ptr.
 

Detailed Description

template<class T>
class xplc_ptr< T >

Smart pointer class for XPLC interfaces.

Definition at line 56 of file debian/libwvstreams-dev/usr/include/wvstreams/xplc/ptr.h.

Constructor & Destructor Documentation

◆ xplc_ptr() [1/6]

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

◆ xplc_ptr() [2/6]

template<class T >
xplc_ptr< T >::xplc_ptr ( T *  aObj)
inlineexplicit

Construct an xplc_ptr from a raw pointer.

This is the only way that an xplc_ptr will take ownership of an interface from its previous owner.

Definition at line 80 of file debian/libwvstreams-dev/usr/include/wvstreams/xplc/ptr.h.

◆ xplc_ptr() [3/6]

template<class T >
template<class P >
xplc_ptr< T >::xplc_ptr ( const xplc_ptr< P > &  aObj)
inlineexplicit

Construct an xplc_ptr from another xplc_ptr.

This will addRef the interface, if the xplc_ptr is non-NULL.

Definition at line 88 of file debian/libwvstreams-dev/usr/include/wvstreams/xplc/ptr.h.

◆ ~xplc_ptr() [1/2]

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

◆ xplc_ptr() [4/6]

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

Definition at line 72 of file include/xplc/ptr.h.

◆ xplc_ptr() [5/6]

template<class T >
xplc_ptr< T >::xplc_ptr ( T *  aObj)
inlineexplicit

Construct an xplc_ptr from a raw pointer.

This is the only way that an xplc_ptr will take ownership of an interface from its previous owner.

Definition at line 80 of file include/xplc/ptr.h.

◆ xplc_ptr() [6/6]

template<class T >
template<class P >
xplc_ptr< T >::xplc_ptr ( const xplc_ptr< P > &  aObj)
inlineexplicit

Construct an xplc_ptr from another xplc_ptr.

This will addRef the interface, if the xplc_ptr is non-NULL.

Definition at line 88 of file include/xplc/ptr.h.

◆ ~xplc_ptr() [2/2]

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

Definition at line 93 of file include/xplc/ptr.h.

Member Function Documentation

◆ operator->() [1/2]

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

Provide an operator->.

This allows you to invoke methods on the interface pointed at by the xplc_ptr. As with a raw pointer, if the xplc_ptr is NULL, this will cause a crash. The interface is wrapped in some basic protection, to avoid accidental addRef or release.

Definition at line 104 of file debian/libwvstreams-dev/usr/include/wvstreams/xplc/ptr.h.

◆ operator ProtectedPtr *() [1/2]

template<class T >
xplc_ptr< T >::operator ProtectedPtr * ( ) const
inline

Provide an operator*.

This is so you can use "*foo" with an xplc_ptr like you could with the raw pointer. It also applies some basic protection.

Definition at line 112 of file debian/libwvstreams-dev/usr/include/wvstreams/xplc/ptr.h.

◆ operator=() [1/2]

template<class T >
xplc_ptr & xplc_ptr< T >::operator= ( T *  _ptr)
inline

Assign a raw pointer to an xplc_ptr.

This will addRef the interface, and release the interface previously pointed at by the xplc_ptr, if any.

Definition at line 120 of file debian/libwvstreams-dev/usr/include/wvstreams/xplc/ptr.h.

◆ operator->() [2/2]

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

Provide an operator->.

This allows you to invoke methods on the interface pointed at by the xplc_ptr. As with a raw pointer, if the xplc_ptr is NULL, this will cause a crash. The interface is wrapped in some basic protection, to avoid accidental addRef or release.

Definition at line 104 of file include/xplc/ptr.h.

◆ operator ProtectedPtr *() [2/2]

template<class T >
xplc_ptr< T >::operator ProtectedPtr * ( ) const
inline

Provide an operator*.

This is so you can use "*foo" with an xplc_ptr like you could with the raw pointer. It also applies some basic protection.

Definition at line 112 of file include/xplc/ptr.h.

◆ operator=() [2/2]

template<class T >
xplc_ptr & xplc_ptr< T >::operator= ( T *  _ptr)
inline

Assign a raw pointer to an xplc_ptr.

This will addRef the interface, and release the interface previously pointed at by the xplc_ptr, if any.

Definition at line 120 of file include/xplc/ptr.h.


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