winss
Public Member Functions | List of all members
winss::TrustedHandleWrapper Class Reference

#include <handle_wrapper.hpp>

Inheritance diagram for winss::TrustedHandleWrapper:
Inheritance graph
[legend]
Collaboration diagram for winss::TrustedHandleWrapper:
Collaboration graph
[legend]

Public Member Functions

 TrustedHandleWrapper ()=default
 Create an empty handle wrapper. More...
 
 TrustedHandleWrapper (HANDLE handle, DWORD dup_rights=0)
 Create a new handle wrapper with access to the wrapped handle. More...
 
 TrustedHandleWrapper (const TrustedHandleWrapper &h)=default
 Copies the handle wrapper. More...
 
 TrustedHandleWrapper (TrustedHandleWrapper &&h)=default
 Move the handle wrapper. More...
 
HANDLE GetHandle () const
 Gets the handle that is wrapped. More...
 
HandleWrapper GetHandleWrapper () const
 Gets a non-owned handle wrapper. More...
 
TrustedHandleWrapperoperator= (const TrustedHandleWrapper &h)=default
 Copies the handle wrapper. More...
 
TrustedHandleWrapperoperator= (TrustedHandleWrapper &&h)=default
 Move the handle wrapper. More...
 
- Public Member Functions inherited from winss::HandleWrapper
 HandleWrapper ()
 Create an empty handle wrapper. More...
 
 HandleWrapper (HANDLE handle, bool owned=true, DWORD dup_rights=0)
 Create a new handle wrapper. More...
 
 HandleWrapper (const HandleWrapper &h)
 Copies the handle wrapper. More...
 
 HandleWrapper (HandleWrapper &&h)
 Move the handle wrapper. More...
 
bool HasHandle () const
 Gets if the wrapper contains a handle. More...
 
bool IsOwner () const
 Gets if this instance owns the handle. More...
 
DWORD GetDuplicateRights () const
 Gets the duplicate rights of the handle. More...
 
WaitResult Wait (DWORD timeout) const
 Waits for an event on the handle. More...
 
HANDLE Duplicate (bool inherit) const
 Duplicates the handle. More...
 
bool operator== (const HandleWrapper &rhs) const
 Checks the handles are equal. More...
 
bool operator!= (const HandleWrapper &rhs) const
 Checks the handles are not equal. More...
 
bool operator< (const HandleWrapper &rhs) const
 Checks this handle is less than the rhs. More...
 
bool operator<= (const HandleWrapper &rhs) const
 Checks this handle is less than or equal to the rhs. More...
 
bool operator> (const HandleWrapper &rhs) const
 Checks this handle is greater than the rhs. More...
 
bool operator>= (const HandleWrapper &rhs) const
 Checks this handle is greater than or equal to the rhs. More...
 
HandleWrapperoperator= (const HandleWrapper &h)
 Copies the handle wrapper. More...
 
HandleWrapperoperator= (HandleWrapper &&h)
 Move the handle wrapper. More...
 
virtual ~HandleWrapper ()
 Cleans up the handle. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from winss::HandleWrapper
template<typename Iterator >
static WaitResult Wait (DWORD timeout, Iterator begin, Iterator end)
 Waits for an event on a sequence of handles. More...
 
- Protected Member Functions inherited from winss::HandleWrapper
void CloseHandle ()
 Close the handle if the instance owns it. More...
 
- Static Protected Member Functions inherited from winss::HandleWrapper
static WaitResult Wait (DWORD timeout, const std::vector< HANDLE > &handles)
 Waits for an event to happen on the given list of handles. More...
 
- Protected Attributes inherited from winss::HandleWrapper
bool owned
 If this instance owns the handle. More...
 
HANDLE handle
 The wrapped handle. More...
 
DWORD dup_rights
 The duplicate rights. More...
 

Constructor & Destructor Documentation

winss::TrustedHandleWrapper::TrustedHandleWrapper ( )
default

Create an empty handle wrapper.

winss::TrustedHandleWrapper::TrustedHandleWrapper ( HANDLE  handle,
DWORD  dup_rights = 0 
)
explicit

Create a new handle wrapper with access to the wrapped handle.

Parameters
handleThe handle to wrap.
dup_rightsThe duplicate rights on the handle.
winss::TrustedHandleWrapper::TrustedHandleWrapper ( const TrustedHandleWrapper h)
default

Copies the handle wrapper.

Any ownership rights will not be copied.

Parameters
hThe handle wrapper to copy.
winss::TrustedHandleWrapper::TrustedHandleWrapper ( TrustedHandleWrapper &&  h)
default

Move the handle wrapper.

Any ownership rights will be moved

Parameters
hThe handle wrapper to move.

Member Function Documentation

HANDLE winss::TrustedHandleWrapper::GetHandle ( ) const

Gets the handle that is wrapped.

Returns
the wrapped handle.

References winss::HandleWrapper::handle.

Referenced by winss::EventWrapper::IsSet(), winss::EventWrapper::Reset(), and winss::EventWrapper::Set().

winss::HandleWrapper winss::TrustedHandleWrapper::GetHandleWrapper ( ) const

Gets a non-owned handle wrapper.

Returns
A new handle wrapper.

References winss::HandleWrapper::dup_rights, and winss::HandleWrapper::handle.

Referenced by winss::EventWrapper::GetHandle().

TrustedHandleWrapper& winss::TrustedHandleWrapper::operator= ( const TrustedHandleWrapper h)
default

Copies the handle wrapper.

Any ownership rights will not be copied.

Parameters
hThe handle wrapper to copy.
TrustedHandleWrapper& winss::TrustedHandleWrapper::operator= ( TrustedHandleWrapper &&  h)
default

Move the handle wrapper.

  • Any ownership rights will be moved
Parameters
hThe handle wrapper owner to move.
Returns
This handle wrapper owner.

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