foobar2000 SDK  2015-08-03
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 250 of file win-objects.h.

Constructor & Destructor Documentation

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

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

262 {}

Member Function Documentation

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

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

256  {
257  long val = --m_refcounter;
258  if (val == 0) delete this;
259  return val;
260  }
pfc::refcounter m_refcounter
Definition: win-objects.h:264
template<typename TBase >
ImplementCOMRefCounter< TBase >::TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD ( ImplementCOMRefCounter< TBase ,
TBase   
)
inline

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

253  {
254  return ++m_refcounter;
255  }
pfc::refcounter m_refcounter
Definition: win-objects.h:264

Field Documentation

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

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


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