foobar2000 SDK  2015-01-14
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
pfc::com_ptr_t< T >

#include <com_ptr_t.h>

Public Types

typedef com_ptr_t< Tt_self
 

Public Member Functions

 com_ptr_t () throw ()
 
template<typename source >
 com_ptr_t (source *p_ptr) throw ()
 
 com_ptr_t (const t_self &p_source) throw ()
 
template<typename source >
 com_ptr_t (const com_ptr_t< source > &p_source) throw ()
 
 ~com_ptr_t () throw ()
 
void attach (T *p_ptr) throw ()
 
void copy (T *p_ptr) throw ()
 
template<typename source >
void copy (const com_ptr_t< source > &p_source) throw ()
 
Tdetach () throw ()
 
Tduplicate_ptr () const throw ()
 
Tget_ptr () const throw ()
 
bool is_empty () const throw ()
 
bool is_valid () const throw ()
 
bool operator!= (const com_ptr_t< T > &p_item) const throw ()
 
Toperator-> () const throw ()
 
bool operator< (const com_ptr_t< T > &p_item) const throw ()
 
t_selfoperator<< (t_self &p_source) throw ()
 
const t_selfoperator= (const t_self &p_source) throw ()
 
const t_selfoperator= (T *p_source) throw ()
 
template<typename source >
const t_selfoperator= (const com_ptr_t< source > &p_source) throw ()
 
template<typename source >
const t_selfoperator= (source *p_ptr) throw ()
 
bool operator== (const com_ptr_t< T > &p_item) const throw ()
 
bool operator> (const com_ptr_t< T > &p_item) const throw ()
 
t_selfoperator>> (t_self &p_dest) throw ()
 
T ** receive_ptr () throw ()
 
void ** receive_void_ptr () throw ()
 
void release () throw ()
 

Static Public Member Functions

static void g_swap (com_ptr_t< T > &item1, com_ptr_t< T > &item2) throw ()
 

Private Attributes

Tm_ptr
 

Detailed Description

template<class T>
class pfc::com_ptr_t< T >

Definition at line 12 of file com_ptr_t.h.

Member Typedef Documentation

template<class T>
typedef com_ptr_t<T> pfc::com_ptr_t< T >::t_self

Definition at line 14 of file com_ptr_t.h.

Constructor & Destructor Documentation

template<class T>
pfc::com_ptr_t< T >::com_ptr_t ( )
throw (
)
inline

Definition at line 16 of file com_ptr_t.h.

16 : m_ptr() {}
template<class T>
template<typename source >
pfc::com_ptr_t< T >::com_ptr_t ( source *  p_ptr)
throw (
)
inline

Definition at line 17 of file com_ptr_t.h.

17 : m_ptr(p_ptr) {_COM_AddRef(m_ptr);}
static void _COM_AddRef(what *ptr)
Definition: com_ptr_t.h:4
template<class T>
pfc::com_ptr_t< T >::com_ptr_t ( const t_self p_source)
throw (
)
inline

Definition at line 18 of file com_ptr_t.h.

18 : m_ptr(p_source.m_ptr) {_COM_AddRef(m_ptr);}
static void _COM_AddRef(what *ptr)
Definition: com_ptr_t.h:4
template<class T>
template<typename source >
pfc::com_ptr_t< T >::com_ptr_t ( const com_ptr_t< source > &  p_source)
throw (
)
inline

Definition at line 19 of file com_ptr_t.h.

19 : m_ptr(p_source.get_ptr()) {_COM_AddRef(m_ptr);}
static void _COM_AddRef(what *ptr)
Definition: com_ptr_t.h:4
template<class T>
pfc::com_ptr_t< T >::~com_ptr_t ( )
throw (
)
inline

Definition at line 21 of file com_ptr_t.h.

static void _COM_Release(what *ptr)
Definition: com_ptr_t.h:7

Member Function Documentation

template<class T>
void pfc::com_ptr_t< T >::attach ( T p_ptr)
throw (
)
inline

Definition at line 31 of file com_ptr_t.h.

31  {
33  m_ptr = p_ptr;
34  }
static void _COM_Release(what *ptr)
Definition: com_ptr_t.h:7
template<class T>
void pfc::com_ptr_t< T >::copy ( T p_ptr)
throw (
)
inline

Definition at line 23 of file com_ptr_t.h.

23  {
25  m_ptr = p_ptr;
27  }
static void _COM_Release(what *ptr)
Definition: com_ptr_t.h:7
static void _COM_AddRef(what *ptr)
Definition: com_ptr_t.h:4
template<class T>
template<typename source >
void pfc::com_ptr_t< T >::copy ( const com_ptr_t< source > &  p_source)
throw (
)
inline

Definition at line 29 of file com_ptr_t.h.

29 {copy(p_source.get_ptr());}
void copy(T *p_ptr)
Definition: com_ptr_t.h:23
template<class T>
T* pfc::com_ptr_t< T >::detach ( )
throw (
)
inline

Definition at line 57 of file com_ptr_t.h.

57  {
58  return replace_null_t(m_ptr);
59  }
t_type replace_null_t(t_type &p_var)
Definition: primitives.h:688
template<class T>
T* pfc::com_ptr_t< T >::duplicate_ptr ( ) const
throw (
)
inline

Definition at line 51 of file com_ptr_t.h.

52  {
54  return m_ptr;
55  }
static void _COM_AddRef(what *ptr)
Definition: com_ptr_t.h:4
template<class T>
static void pfc::com_ptr_t< T >::g_swap ( com_ptr_t< T > &  item1,
com_ptr_t< T > &  item2 
)
throw (
)
inlinestatic

Definition at line 69 of file com_ptr_t.h.

69  {
70  pfc::swap_t(item1.m_ptr,item2.m_ptr);
71  }
void swap_t(T &p_item1, T &p_item2)
Definition: primitives.h:285
template<class T>
T* pfc::com_ptr_t< T >::get_ptr ( ) const
throw (
)
inline

Definition at line 49 of file com_ptr_t.h.

49 {return m_ptr;}
template<class T>
bool pfc::com_ptr_t< T >::is_empty ( ) const
throw (
)
inline

Definition at line 62 of file com_ptr_t.h.

62 {return m_ptr == 0;}
template<class T>
bool pfc::com_ptr_t< T >::is_valid ( ) const
throw (
)
inline

Definition at line 61 of file com_ptr_t.h.

61 {return m_ptr != 0;}
template<class T>
bool pfc::com_ptr_t< T >::operator!= ( const com_ptr_t< T > &  p_item) const
throw (
)
inline

Definition at line 65 of file com_ptr_t.h.

65 {return m_ptr != p_item.m_ptr;}
template<class T>
T* pfc::com_ptr_t< T >::operator-> ( ) const
throw (
)
inline

Definition at line 47 of file com_ptr_t.h.

47 {PFC_ASSERT(m_ptr);return m_ptr;}
template<class T>
bool pfc::com_ptr_t< T >::operator< ( const com_ptr_t< T > &  p_item) const
throw (
)
inline

Definition at line 67 of file com_ptr_t.h.

67 {return m_ptr < p_item.m_ptr;}
template<class T>
t_self& pfc::com_ptr_t< T >::operator<< ( t_self p_source)
throw (
)
inline

Definition at line 76 of file com_ptr_t.h.

76 {attach(p_source.detach());return *this;}
void attach(T *p_ptr)
Definition: com_ptr_t.h:31
template<class T>
const t_self& pfc::com_ptr_t< T >::operator= ( const t_self p_source)
throw (
)
inline

Definition at line 36 of file com_ptr_t.h.

36 {copy(p_source); return *this;}
void copy(T *p_ptr)
Definition: com_ptr_t.h:23
template<class T>
const t_self& pfc::com_ptr_t< T >::operator= ( T p_source)
throw (
)
inline

Definition at line 37 of file com_ptr_t.h.

37 {copy(p_source); return *this;}
void copy(T *p_ptr)
Definition: com_ptr_t.h:23
template<class T>
template<typename source >
const t_self& pfc::com_ptr_t< T >::operator= ( const com_ptr_t< source > &  p_source)
throw (
)
inline

Definition at line 38 of file com_ptr_t.h.

38 {copy(p_source); return *this;}
void copy(T *p_ptr)
Definition: com_ptr_t.h:23
template<class T>
template<typename source >
const t_self& pfc::com_ptr_t< T >::operator= ( source *  p_ptr)
throw (
)
inline

Definition at line 39 of file com_ptr_t.h.

39 {copy(p_ptr); return *this;}
void copy(T *p_ptr)
Definition: com_ptr_t.h:23
template<class T>
bool pfc::com_ptr_t< T >::operator== ( const com_ptr_t< T > &  p_item) const
throw (
)
inline

Definition at line 64 of file com_ptr_t.h.

64 {return m_ptr == p_item.m_ptr;}
template<class T>
bool pfc::com_ptr_t< T >::operator> ( const com_ptr_t< T > &  p_item) const
throw (
)
inline

Definition at line 66 of file com_ptr_t.h.

66 {return m_ptr > p_item.m_ptr;}
template<class T>
t_self& pfc::com_ptr_t< T >::operator>> ( t_self p_dest)
throw (
)
inline

Definition at line 77 of file com_ptr_t.h.

77 {p_dest.attach(detach());return *this;}
T * detach()
Definition: com_ptr_t.h:57
template<class T>
T** pfc::com_ptr_t< T >::receive_ptr ( )
throw (
)
inline

Definition at line 73 of file com_ptr_t.h.

73 {release();return &m_ptr;}
void release()
Definition: com_ptr_t.h:41
template<class T>
void** pfc::com_ptr_t< T >::receive_void_ptr ( )
throw (
)
inline

Definition at line 74 of file com_ptr_t.h.

74 {return (void**) receive_ptr();}
T ** receive_ptr()
Definition: com_ptr_t.h:73
template<class T>
void pfc::com_ptr_t< T >::release ( )
throw (
)
inline

Definition at line 41 of file com_ptr_t.h.

41  {
43  m_ptr = NULL;
44  }
static void _COM_Release(what *ptr)
Definition: com_ptr_t.h:7

Field Documentation

template<class T>
T* pfc::com_ptr_t< T >::m_ptr
private

Definition at line 79 of file com_ptr_t.h.


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