ReactOS  0.4.12-dev-51-ge94618b
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 231 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComAggObject()

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

Definition at line 236 of file atlcom.h.

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

◆ ~CComAggObject()

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

Definition at line 241 of file atlcom.h.

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

Member Function Documentation

◆ CreateInstance()

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

Definition at line 281 of file atlcom.h.

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

◆ FinalConstruct()

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

Definition at line 247 of file atlcom.h.

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

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

◆ FinalRelease()

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

Definition at line 251 of file atlcom.h.

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

◆ QueryInterface()

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

Definition at line 270 of file atlcom.h.

271  {
272  if (ppvObject == NULL)
273  return E_POINTER;
274  if (iid == IID_IUnknown)
275  *ppvObject = reinterpret_cast<void*>(this);
276  else
277  return m_contained._InternalQueryInterface(iid, ppvObject);
278  return S_OK;
279  }
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
CComContainedObject< contained > m_contained
Definition: atlcom.h:234

◆ STDMETHOD_() [1/2]

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

Definition at line 256 of file atlcom.h.

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

◆ STDMETHOD_() [2/2]

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

Definition at line 261 of file atlcom.h.

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

Member Data Documentation

◆ m_contained

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

Definition at line 234 of file atlcom.h.


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