The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CSmartHandle Class Reference
[Smart Pointer]

Inheritance diagram for CSmartHandle:
Collaboration diagram for CSmartHandle:

List of all members.


Detailed Description

A smart pointer to a HANDLE. Calls CloseHandle() on any HANDLE that the it owns when the CSmartHandle goes out of scope to aid in scope based designs.


Public Member Functions

 CSmartHandle ()
 Construct a CSmartHandle that doesn't, currently, own a HANDLE.
 CSmartHandle (HANDLE handle)
 Construct a CSmartHandle that takes ownership of the supplied HANDLE.
 CSmartHandle (const CSmartHandle &rhs)
 ~CSmartHandle () override
CSmartHandleoperator= (HANDLE handle)
CSmartHandleoperator= (const CSmartHandle &rhs)
 operator HANDLE () const
 Access the HANDLE... We should remove this...
HANDLEGetHandle ()
HANDLE GetHandle () const
void Attach (HANDLE handle)
 Take ownership of the supplied HANDLE.
HANDLE Detach ()
 No longer manage ownership of the HANDLE and return it.
CSmartHandle DuplicateHandle () const
 Duplicate the owned handle with the same access for use within the same process.
void Close ()
 Close any handle that is managed by this CSmartHandle.
bool IsValid () const
 Returns true if the CSmartHandle currently has ownership of a HANDLE.
HANDLE GetWaitHandle () const override
void Wait () const override
bool Wait (Milliseconds timeoutMillis) const override

Static Public Member Functions

static CSmartHandle DuplicateHandle (HANDLE hInput)
 Duplicate the owned handle with the same access for use within the same process.


Constructor & Destructor Documentation

CSmartHandle (  ) 

Construct a CSmartHandle that doesn't, currently, own a HANDLE.

CSmartHandle ( HANDLE  handle  )  [explicit]

Construct a CSmartHandle that takes ownership of the supplied HANDLE.

CSmartHandle ( const CSmartHandle rhs  ) 

~CSmartHandle (  )  [override]


Member Function Documentation

CSmartHandle DuplicateHandle ( HANDLE  hInput  )  [static]

Duplicate the owned handle with the same access for use within the same process.

CSmartHandle & operator= ( HANDLE  handle  ) 

CSmartHandle & operator= ( const CSmartHandle rhs  ) 

operator HANDLE (  )  const

Access the HANDLE... We should remove this...

HANDLE & GetHandle (  ) 

HANDLE GetHandle (  )  const

void Attach ( HANDLE  handle  ) 

Take ownership of the supplied HANDLE.

HANDLE Detach (  ) 

No longer manage ownership of the HANDLE and return it.

CSmartHandle DuplicateHandle (  )  const

Duplicate the owned handle with the same access for use within the same process.

void Close (  ) 

Close any handle that is managed by this CSmartHandle.

bool IsValid (  )  const

Returns true if the CSmartHandle currently has ownership of a HANDLE.

HANDLE GetWaitHandle (  )  const [override]

void Wait (  )  const [override]

bool Wait ( Milliseconds  timeoutMillis  )  const [override]


Generated on Sun Sep 12 19:11:49 2021 for The Server Framework - v7.4 by doxygen 1.5.3