ReactOS  0.4.15-dev-3193-g74513a7
ATL::CComAggObject< contained > Class Template Reference

#include <atlcom.h>

Inheritance diagram for ATL::CComAggObject< contained >:
Collaboration diagram for ATL::CComAggObject< contained >:

Public Member Functions

 CComAggObject (void *pv=NULL)
 
virtual ~CComAggObject ()
 
HRESULT FinalConstruct ()
 
void FinalRelease ()
 
 STDMETHOD_ (ULONG, AddRef)()
 
 STDMETHOD_ (ULONG, Release)()
 
STDMETHOD() QueryInterface (REFIID iid, void **ppvObject)
 

Static Public Member Functions

static HRESULT WINAPI CreateInstance (IUnknown *punkOuter, CComAggObject< contained > **pp)
 

Public Attributes

CComContainedObject< contained > m_contained
 

Detailed Description

template<class contained>
class ATL::CComAggObject< contained >

Definition at line 232 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComAggObject()

template<class contained>
ATL::CComAggObject< contained >::CComAggObject ( void pv = NULL)
inline

Definition at line 237 of file atlcom.h.

237  : m_contained(static_cast<contained*>(pv))
238  {
239  _pAtlModule->Lock();
240  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:235

◆ ~CComAggObject()

template<class contained>
virtual ATL::CComAggObject< contained >::~CComAggObject ( )
inlinevirtual

Definition at line 242 of file atlcom.h.

243  {
244  this->FinalRelease();
245  _pAtlModule->Unlock();
246  }
void FinalRelease()
Definition: atlcom.h:252

Member Function Documentation

◆ CreateInstance()

template<class contained>
static HRESULT WINAPI ATL::CComAggObject< contained >::CreateInstance ( IUnknown punkOuter,
CComAggObject< contained > **  pp 
)
inlinestatic

Definition at line 282 of file atlcom.h.

283  {
284  CComAggObject<contained> *newInstance;
285  HRESULT hResult;
286 
287  ATLASSERT(pp != NULL);
288  if (pp == NULL)
289  return E_POINTER;
290 
291  hResult = E_OUTOFMEMORY;
292  newInstance = NULL;
293  ATLTRY(newInstance = new CComAggObject<contained>(punkOuter))
294  if (newInstance != NULL)
295  {
296  newInstance->SetVoid(NULL);
297  newInstance->InternalFinalConstructAddRef();
298  hResult = newInstance->_AtlInitialConstruct();
299  if (SUCCEEDED(hResult))
300  hResult = newInstance->FinalConstruct();
301  if (SUCCEEDED(hResult))
302  hResult = newInstance->_AtlFinalConstruct();
303  newInstance->InternalFinalConstructRelease();
304  if (hResult != S_OK)
305  {
306  delete newInstance;
307  newInstance = NULL;
308  }
309  }
310  *pp = newInstance;
311  return hResult;
312  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
#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

◆ FinalConstruct()

template<class contained>
HRESULT ATL::CComAggObject< contained >::FinalConstruct ( )
inline

Definition at line 248 of file atlcom.h.

249  {
250  return m_contained.FinalConstruct();
251  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:235

Referenced by ATL::CComAggObject< contained >::CreateInstance().

◆ FinalRelease()

template<class contained>
void ATL::CComAggObject< contained >::FinalRelease ( )
inline

Definition at line 252 of file atlcom.h.

253  {
254  m_contained.FinalRelease();
255  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:235

Referenced by ATL::CComAggObject< contained >::~CComAggObject().

◆ QueryInterface()

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

Definition at line 271 of file atlcom.h.

272  {
273  if (ppvObject == NULL)
274  return E_POINTER;
275  if (iid == IID_IUnknown)
276  *ppvObject = reinterpret_cast<void*>(this);
277  else
278  return m_contained._InternalQueryInterface(iid, ppvObject);
279  return S_OK;
280  }
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define E_POINTER
Definition: winerror.h:2365
CComContainedObject< contained > m_contained
Definition: atlcom.h:235

◆ STDMETHOD_() [1/2]

template<class contained>
ATL::CComAggObject< contained >::STDMETHOD_ ( ULONG  ,
AddRef   
)
inline

Definition at line 257 of file atlcom.h.

258  {
259  return this->InternalAddRef();
260  }

◆ STDMETHOD_() [2/2]

template<class contained>
ATL::CComAggObject< contained >::STDMETHOD_ ( ULONG  ,
Release   
)
inline

Definition at line 262 of file atlcom.h.

263  {
264  ULONG newRefCount;
265  newRefCount = this->InternalRelease();
266  if (newRefCount == 0)
267  delete this;
268  return newRefCount;
269  }
unsigned int ULONG
Definition: retypes.h:1

Member Data Documentation

◆ m_contained


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