ReactOS 0.4.15-dev-7842-g558ab78
ATL::CHandle Class Reference

#include <atlbase.h>

Inheritance diagram for ATL::CHandle:
Collaboration diagram for ATL::CHandle:

Public Member Functions

 CHandle ()
 
 CHandle (_Inout_ CHandle &handle)
 
 CHandle (_In_ HANDLE handle)
 
 ~CHandle ()
 
CHandleoperator= (_Inout_ CHandle &handle)
 
 operator HANDLE () const
 
void Attach (_In_ HANDLE handle)
 
HANDLE Detach ()
 
void Close ()
 

Public Attributes

HANDLE m_handle
 

Detailed Description

Definition at line 301 of file atlbase.h.

Constructor & Destructor Documentation

◆ CHandle() [1/3]

ATL::CHandle::CHandle ( )
inline

Definition at line 307 of file atlbase.h.

307 :
309 {
310 }
HANDLE m_handle
Definition: atlbase.h:304
#define NULL
Definition: types.h:112

◆ CHandle() [2/3]

ATL::CHandle::CHandle ( _Inout_ CHandle handle)
inline

Definition at line 312 of file atlbase.h.

312 :
314 {
315 Attach(handle.Detach());
316 }
void Attach(_In_ HANDLE handle)
Definition: atlbase.h:350

◆ CHandle() [3/3]

ATL::CHandle::CHandle ( _In_ HANDLE  handle)
inlineexplicit

Definition at line 318 of file atlbase.h.

318 :
320 {
321 }

◆ ~CHandle()

ATL::CHandle::~CHandle ( )
inline

Definition at line 323 of file atlbase.h.

324 {
325 if (m_handle)
326 {
327 Close();
328 }
329 }
void Close()
Definition: atlbase.h:363

Member Function Documentation

◆ Attach()

void ATL::CHandle::Attach ( _In_ HANDLE  handle)
inline

◆ Close()

void ATL::CHandle::Close ( )
inline

Definition at line 363 of file atlbase.h.

364 {
365 if (m_handle)
366 {
368 m_handle = NULL;
369 }
370 }
#define CloseHandle
Definition: compat.h:739

Referenced by operator=(), and ~CHandle().

◆ Detach()

HANDLE ATL::CHandle::Detach ( )
inline

Definition at line 356 of file atlbase.h.

357 {
359 m_handle = NULL;
360 return handle;
361 }

◆ operator HANDLE()

ATL::CHandle::operator HANDLE ( ) const
inline

Definition at line 345 of file atlbase.h.

346 {
347 return m_handle;
348 }

◆ operator=()

CHandle & ATL::CHandle::operator= ( _Inout_ CHandle handle)
inline

Definition at line 331 of file atlbase.h.

332 {
333 if (this != &handle)
334 {
335 if (m_handle)
336 {
337 Close();
338 }
339 Attach(handle.Detach());
340 }
341
342 return *this;
343 }

Member Data Documentation

◆ m_handle

HANDLE ATL::CHandle::m_handle

Definition at line 304 of file atlbase.h.

Referenced by Attach(), Close(), Detach(), operator HANDLE(), operator=(), and ~CHandle().


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