ReactOS  0.4.12-dev-51-ge94618b
ATL::CHandle Class Reference

#include <atlbase.h>

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 263 of file atlbase.h.

Constructor & Destructor Documentation

◆ CHandle() [1/3]

ATL::CHandle::CHandle ( )
inline

Definition at line 269 of file atlbase.h.

269  :
270  m_handle(NULL)
271  {
272  }
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:266

◆ CHandle() [2/3]

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

Definition at line 274 of file atlbase.h.

274  :
275  m_handle(NULL)
276  {
277  Attach(handle.Detach());
278  }
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:266
void Attach(_In_ HANDLE handle)
Definition: atlbase.h:312

◆ CHandle() [3/3]

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

Definition at line 280 of file atlbase.h.

280  :
282  {
283  }
HANDLE m_handle
Definition: atlbase.h:266

◆ ~CHandle()

ATL::CHandle::~CHandle ( )
inline

Definition at line 285 of file atlbase.h.

286  {
287  if (m_handle)
288  {
289  Close();
290  }
291  }
void Close()
Definition: atlbase.h:325
HANDLE m_handle
Definition: atlbase.h:266

Member Function Documentation

◆ Attach()

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

Definition at line 312 of file atlbase.h.

313  {
314  ATLASSERT(m_handle == NULL);
315  m_handle = handle;
316  }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:266

◆ Close()

void ATL::CHandle::Close ( void  )
inline

Definition at line 325 of file atlbase.h.

326  {
327  if (m_handle)
328  {
330  m_handle = NULL;
331  }
332  }
#define CloseHandle
Definition: compat.h:398
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:266

◆ Detach()

HANDLE ATL::CHandle::Detach ( )
inline

Definition at line 318 of file atlbase.h.

319  {
321  m_handle = NULL;
322  return handle;
323  }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:266

◆ operator HANDLE()

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

Definition at line 307 of file atlbase.h.

308  {
309  return m_handle;
310  }
HANDLE m_handle
Definition: atlbase.h:266

◆ operator=()

Definition at line 293 of file atlbase.h.

294  {
295  if (this != &handle)
296  {
297  if (m_handle)
298  {
299  Close();
300  }
301  Attach(handle.Detach());
302  }
303 
304  return *this;
305  }
void Close()
Definition: atlbase.h:325
HANDLE m_handle
Definition: atlbase.h:266
void Attach(_In_ HANDLE handle)
Definition: atlbase.h:312

Member Data Documentation

◆ m_handle

HANDLE ATL::CHandle::m_handle

Definition at line 266 of file atlbase.h.


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