ReactOS 0.4.15-dev-8339-g4028de8
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 237 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComAggObject()

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

Definition at line 242 of file atlcom.h.

242 : m_contained(static_cast<contained*>(pv))
243 {
244 _pAtlModule->Lock();
245 }
CComContainedObject< contained > m_contained
Definition: atlcom.h:240

◆ ~CComAggObject()

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

Definition at line 247 of file atlcom.h.

248 {
249 this->FinalRelease();
250 _pAtlModule->Unlock();
251 }
void FinalRelease()
Definition: atlcom.h:257

Member Function Documentation

◆ CreateInstance()

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

Definition at line 287 of file atlcom.h.

288 {
289 CComAggObject<contained> *newInstance;
290 HRESULT hResult;
291
292 ATLASSERT(pp != NULL);
293 if (pp == NULL)
294 return E_POINTER;
295
296 hResult = E_OUTOFMEMORY;
297 newInstance = NULL;
298 ATLTRY(newInstance = new CComAggObject<contained>(punkOuter))
299 if (newInstance != NULL)
300 {
301 newInstance->SetVoid(NULL);
302 newInstance->InternalFinalConstructAddRef();
303 hResult = newInstance->_AtlInitialConstruct();
304 if (SUCCEEDED(hResult))
305 hResult = newInstance->FinalConstruct();
306 if (SUCCEEDED(hResult))
307 hResult = newInstance->_AtlFinalConstruct();
308 newInstance->InternalFinalConstructRelease();
309 if (hResult != S_OK)
310 {
311 delete newInstance;
312 newInstance = NULL;
313 }
314 }
315 *pp = newInstance;
316 return hResult;
317 }
#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
#define E_POINTER
Definition: winerror.h:2365

◆ FinalConstruct()

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

Definition at line 253 of file atlcom.h.

254 {
255 return m_contained.FinalConstruct();
256 }

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

◆ FinalRelease()

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

Definition at line 257 of file atlcom.h.

258 {
259 m_contained.FinalRelease();
260 }

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

◆ QueryInterface()

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

Definition at line 276 of file atlcom.h.

277 {
278 if (ppvObject == NULL)
279 return E_POINTER;
280 if (iid == IID_IUnknown)
281 *ppvObject = reinterpret_cast<void*>(this);
282 else
283 return m_contained._InternalQueryInterface(iid, ppvObject);
284 return S_OK;
285 }
const GUID IID_IUnknown
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ STDMETHOD_() [1/2]

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

Definition at line 262 of file atlcom.h.

263 {
264 return this->InternalAddRef();
265 }

◆ STDMETHOD_() [2/2]

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

Definition at line 267 of file atlcom.h.

268 {
269 ULONG newRefCount;
270 newRefCount = this->InternalRelease();
271 if (newRefCount == 0)
272 delete this;
273 return newRefCount;
274 }
uint32_t ULONG
Definition: typedefs.h:59

Member Data Documentation

◆ m_contained


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