foobar2000 SDK  2015-01-14
Public Member Functions | Protected Member Functions | Private Attributes
ImplementCOMRefCounter< TBase >

#include <win-objects.h>

+ Inheritance diagram for ImplementCOMRefCounter< TBase >:

Public Member Functions

ULONG STDMETHODCALLTYPE Release ()
 
 TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD (ImplementCOMRefCounter, TBase) ULONG STDMETHODCALLTYPE AddRef()
 

Protected Member Functions

virtual ~ImplementCOMRefCounter ()
 

Private Attributes

pfc::refcounter m_refcounter
 

Detailed Description

template<typename TBase>
class ImplementCOMRefCounter< TBase >

Simple implementation of a COM reference counter. The initial reference count is zero, so it can be used with pfc::com_ptr_t<> with plain operator=/constructor rather than attach().

Definition at line 243 of file win-objects.h.

Constructor & Destructor Documentation

template<typename TBase >
virtual ImplementCOMRefCounter< TBase >::~ImplementCOMRefCounter ( )
inlineprotectedvirtual

Definition at line 255 of file win-objects.h.

255 {}

Member Function Documentation

template<typename TBase >
ULONG STDMETHODCALLTYPE ImplementCOMRefCounter< TBase >::Release ( )
inline

Definition at line 249 of file win-objects.h.

249  {
250  long val = --m_refcounter;
251  if (val == 0) delete this;
252  return val;
253  }
pfc::refcounter m_refcounter
Definition: win-objects.h:257
template<typename TBase >
ImplementCOMRefCounter< TBase >::TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD ( ImplementCOMRefCounter< TBase ,
TBase   
)
inline

Definition at line 245 of file win-objects.h.

246  {
247  return ++m_refcounter;
248  }
pfc::refcounter m_refcounter
Definition: win-objects.h:257

Field Documentation

template<typename TBase >
pfc::refcounter ImplementCOMRefCounter< TBase >::m_refcounter
private

Definition at line 257 of file win-objects.h.


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