ReactOS  0.4.15-dev-3193-g74513a7
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 470 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComObjectCached()

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

Definition at line 473 of file atlcom.h.

474  {
475  }

◆ ~CComObjectCached()

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

Definition at line 477 of file atlcom.h.

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

Member Function Documentation

◆ CreateInstance()

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

Definition at line 509 of file atlcom.h.

510  {
511  CComObjectCached<Base> *newInstance;
512  HRESULT hResult;
513 
514  ATLASSERT(pp != NULL);
515  if (pp == NULL)
516  return E_POINTER;
517 
518  hResult = E_OUTOFMEMORY;
519  newInstance = NULL;
520  ATLTRY(newInstance = new CComObjectCached<Base>())
521  if (newInstance != NULL)
522  {
523  newInstance->SetVoid(NULL);
524  newInstance->InternalFinalConstructAddRef();
525  hResult = newInstance->_AtlInitialConstruct();
526  if (SUCCEEDED(hResult))
527  hResult = newInstance->FinalConstruct();
528  if (SUCCEEDED(hResult))
529  hResult = newInstance->_AtlFinalConstruct();
530  newInstance->InternalFinalConstructRelease();
531  if (hResult != S_OK)
532  {
533  delete newInstance;
534  newInstance = NULL;
535  }
536  }
537  *pp = newInstance;
538  return hResult;
539  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
if SUCCEEDED(hr)
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define E_POINTER
Definition: winerror.h:2365

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

◆ QueryInterface()

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

Definition at line 504 of file atlcom.h.

505  {
506  return this->_InternalQueryInterface(iid, ppvObject);
507  }
REFIID LPVOID * ppvObject
Definition: precomp.h:44

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

◆ STDMETHOD_() [1/2]

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

Definition at line 482 of file atlcom.h.

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

◆ STDMETHOD_() [2/2]

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

Definition at line 492 of file atlcom.h.

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

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