ReactOS  0.4.13-dev-249-gcba1a2f
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 251 of file atlbase.h.

Constructor & Destructor Documentation

◆ CHandle() [1/3]

ATL::CHandle::CHandle ( )
inline

Definition at line 257 of file atlbase.h.

257  :
258  m_handle(NULL)
259  {
260  }
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:254

◆ CHandle() [2/3]

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

Definition at line 262 of file atlbase.h.

262  :
263  m_handle(NULL)
264  {
265  Attach(handle.Detach());
266  }
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:254
void Attach(_In_ HANDLE handle)
Definition: atlbase.h:300

◆ CHandle() [3/3]

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

Definition at line 268 of file atlbase.h.

268  :
270  {
271  }
HANDLE m_handle
Definition: atlbase.h:254

◆ ~CHandle()

ATL::CHandle::~CHandle ( )
inline

Definition at line 273 of file atlbase.h.

274  {
275  if (m_handle)
276  {
277  Close();
278  }
279  }
void Close()
Definition: atlbase.h:313
HANDLE m_handle
Definition: atlbase.h:254

Member Function Documentation

◆ Attach()

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

Definition at line 300 of file atlbase.h.

301  {
302  ATLASSERT(m_handle == NULL);
303  m_handle = handle;
304  }
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:254

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

◆ Close()

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

Definition at line 313 of file atlbase.h.

314  {
315  if (m_handle)
316  {
318  m_handle = NULL;
319  }
320  }
#define CloseHandle
Definition: compat.h:398
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_handle
Definition: atlbase.h:254

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

◆ Detach()

HANDLE ATL::CHandle::Detach ( )
inline

Definition at line 306 of file atlbase.h.

307  {
309  m_handle = NULL;
310  return handle;
311  }
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:254

◆ operator HANDLE()

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

Definition at line 295 of file atlbase.h.

296  {
297  return m_handle;
298  }
HANDLE m_handle
Definition: atlbase.h:254

◆ operator=()

Definition at line 281 of file atlbase.h.

282  {
283  if (this != &handle)
284  {
285  if (m_handle)
286  {
287  Close();
288  }
289  Attach(handle.Detach());
290  }
291 
292  return *this;
293  }
void Close()
Definition: atlbase.h:313
HANDLE m_handle
Definition: atlbase.h:254
void Attach(_In_ HANDLE handle)
Definition: atlbase.h:300

Member Data Documentation

◆ m_handle

HANDLE ATL::CHandle::m_handle

Definition at line 254 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: