ReactOS 0.4.15-dev-8393-g61b7fb9
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 475 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComObjectCached()

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

Definition at line 478 of file atlcom.h.

479 {
480 }

◆ ~CComObjectCached()

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

Definition at line 482 of file atlcom.h.

483 {
484 this->FinalRelease();
485 }

Member Function Documentation

◆ CreateInstance()

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

Definition at line 514 of file atlcom.h.

515 {
516 CComObjectCached<Base> *newInstance;
517 HRESULT hResult;
518
519 ATLASSERT(pp != NULL);
520 if (pp == NULL)
521 return E_POINTER;
522
523 hResult = E_OUTOFMEMORY;
524 newInstance = NULL;
525 ATLTRY(newInstance = new CComObjectCached<Base>())
526 if (newInstance != NULL)
527 {
528 newInstance->SetVoid(NULL);
529 newInstance->InternalFinalConstructAddRef();
530 hResult = newInstance->_AtlInitialConstruct();
531 if (SUCCEEDED(hResult))
532 hResult = newInstance->FinalConstruct();
533 if (SUCCEEDED(hResult))
534 hResult = newInstance->_AtlFinalConstruct();
535 newInstance->InternalFinalConstructRelease();
536 if (hResult != S_OK)
537 {
538 delete newInstance;
539 newInstance = NULL;
540 }
541 }
542 *pp = newInstance;
543 return hResult;
544 }
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
if(dx< 0)
Definition: linetemp.h:194
#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 509 of file atlcom.h.

510 {
511 return this->_InternalQueryInterface(iid, ppvObject);
512 }
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

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

◆ STDMETHOD_() [1/2]

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

Definition at line 487 of file atlcom.h.

488 {
489 ULONG newRefCount;
490
491 newRefCount = this->InternalAddRef();
492 if (newRefCount == 2)
493 _pAtlModule->Lock();
494 return newRefCount;
495 }
uint32_t ULONG
Definition: typedefs.h:59

◆ STDMETHOD_() [2/2]

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

Definition at line 497 of file atlcom.h.

498 {
499 ULONG newRefCount;
500
501 newRefCount = this->InternalRelease();
502 if (newRefCount == 0)
503 delete this;
504 else if (newRefCount == 1)
505 _pAtlModule->Unlock();
506 return newRefCount;
507 }

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