ReactOS  0.4.12-dev-57-g7050ac4
ATL::CComObjectCached< Base > Class Template Reference

#include <atlcom.h>

Inheritance diagram for ATL::CComObjectCached< Base >:
Collaboration diagram for ATL::CComObjectCached< Base >:

Public Member Functions

 CComObjectCached (void *=NULL)
 
virtual ~CComObjectCached ()
 
 STDMETHOD_ (ULONG, AddRef)()
 
 STDMETHOD_ (ULONG, Release)()
 
STDMETHOD() QueryInterface (REFIID iid, void **ppvObject)
 

Static Public Member Functions

static HRESULT WINAPI CreateInstance (CComObjectCached< Base > **pp)
 

Detailed Description

template<class Base>
class ATL::CComObjectCached< Base >

Definition at line 469 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComObjectCached()

template<class Base>
ATL::CComObjectCached< Base >::CComObjectCached ( void = NULL)
inline

Definition at line 472 of file atlcom.h.

473  {
474  }

◆ ~CComObjectCached()

template<class Base>
virtual ATL::CComObjectCached< Base >::~CComObjectCached ( )
inlinevirtual

Definition at line 476 of file atlcom.h.

477  {
478  this->FinalRelease();
479  }

Member Function Documentation

◆ CreateInstance()

template<class Base>
static HRESULT WINAPI ATL::CComObjectCached< Base >::CreateInstance ( CComObjectCached< Base > **  pp)
inlinestatic

Definition at line 508 of file atlcom.h.

Referenced by ATL::CComClassFactorySingleton< T >::CreateInstance().

509  {
510  CComObjectCached<Base> *newInstance;
511  HRESULT hResult;
512 
513  ATLASSERT(pp != NULL);
514  if (pp == NULL)
515  return E_POINTER;
516 
517  hResult = E_OUTOFMEMORY;
518  newInstance = NULL;
519  ATLTRY(newInstance = new CComObjectCached<Base>())
520  if (newInstance != NULL)
521  {
522  newInstance->SetVoid(NULL);
523  newInstance->InternalFinalConstructAddRef();
524  hResult = newInstance->_AtlInitialConstruct();
525  if (SUCCEEDED(hResult))
526  hResult = newInstance->FinalConstruct();
527  if (SUCCEEDED(hResult))
528  hResult = newInstance->_AtlFinalConstruct();
529  newInstance->InternalFinalConstructRelease();
530  if (hResult != S_OK)
531  {
532  delete newInstance;
533  newInstance = NULL;
534  }
535  }
536  *pp = newInstance;
537  return hResult;
538  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define pp
Definition: hlsl.yy.c:978
smooth NULL
Definition: ftsmooth.c:416
if(!(yy_init))
Definition: macro.lex.yy.c:717
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ QueryInterface()

template<class Base>
STDMETHOD() ATL::CComObjectCached< Base >::QueryInterface ( REFIID  iid,
void **  ppvObject 
)
inline

Definition at line 503 of file atlcom.h.

Referenced by ATL::CComClassFactorySingleton< T >::CreateInstance().

504  {
505  return this->_InternalQueryInterface(iid, ppvObject);
506  }

◆ STDMETHOD_() [1/2]

template<class Base>
ATL::CComObjectCached< Base >::STDMETHOD_ ( ULONG  ,
AddRef   
)
inline

Definition at line 481 of file atlcom.h.

482  {
483  ULONG newRefCount;
484 
485  newRefCount = this->InternalAddRef();
486  if (newRefCount == 2)
487  _pAtlModule->Lock();
488  return newRefCount;
489  }
unsigned int ULONG
Definition: retypes.h:1

◆ STDMETHOD_() [2/2]

template<class Base>
ATL::CComObjectCached< Base >::STDMETHOD_ ( ULONG  ,
Release   
)
inline

Definition at line 491 of file atlcom.h.

492  {
493  ULONG newRefCount;
494 
495  newRefCount = this->InternalRelease();
496  if (newRefCount == 0)
497  delete this;
498  else if (newRefCount == 1)
499  _pAtlModule->Unlock();
500  return newRefCount;
501  }
unsigned int ULONG
Definition: retypes.h:1

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