PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
Declare an RAII container for system API handles (psystem::unique_handle). More...
#include "platform.hpp"
#include "default_close_handle.hpp"
#include "managed_handle_proxy.hpp"
#include "stack_allocated.hpp"
Go to the source code of this file.
Classes | |
class | psystem::unique_handle_impl< T, D, kInvalidHandle > |
Base unique_handle functionality common to all template specializations. More... | |
class | psystem::unique_handle< T, D, kInvalidHandle > |
Uniquely manage a single "handle". More... | |
class | psystem::unique_handle< T, default_close_handle< T >, kInvalidHandle > |
Uniquely manage a single "handle" with (optimized for the default "deleter"). More... | |
struct | std::hash< psystem::unique_handle< T, D, kInvalidHandle > > |
Forward the hash functor along to the underlying handle type for psystem::unique_handle. More... | |
Namespaces | |
psystem | |
Contains the process examination "system" and basic frameworks. | |
Functions | |
template<typename T , typename D , T kInvalidHandle> | |
void | std::swap (psystem::unique_handle< T, D, kInvalidHandle > &o1, psystem::unique_handle< T, D, kInvalidHandle > &o2) noexcept |
Delegate std::swap calls for unique_handle to the member function. More... | |
template<typename T , typename D , T kInvalidHandle> | |
bool | operator== (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
Test for equality of two handles. More... | |
template<typename T , typename D , T kInvalidHandle> | |
bool | operator!= (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
Test for inequality of two handles. More... | |
template<typename T , typename D , T kInvalidHandle> | |
bool | operator< (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
Test if the first handle is less than the second. More... | |
template<typename T , typename D , T kInvalidHandle> | |
bool | operator<= (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
Test if the first handle is less than or equal to the second. More... | |
template<typename T , typename D , T kInvalidHandle> | |
bool | operator> (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
Test if the first handle is greater than the second. More... | |
template<typename T , typename D , T kInvalidHandle> | |
bool | operator>= (psystem::unique_handle< T, D, kInvalidHandle > const &h1, psystem::unique_handle< T, D, kInvalidHandle > const &h2) noexcept |
Test if the first handle is greater than or equal to the second. More... | |
Declare an RAII container for system API handles (psystem::unique_handle).
unique_handle
to simple handle
types for a few reasons. First, it is difficult challenging (not impossible) to decide on a type for the unmanaged handle because handles are generally pointers or even integers that have been given another name via typedef. They may also be forward declarations of a type as well. The second reason is that many handle types will conflict with the bool
operator—the expression "unique_handle(hndl) == hndl"
may first convert the unique_handle
to a bool, then use a simple equality operator that compares POD integers, or it call the operator==
that takes unique_handle
and the handle type. There is ambiguity. We will therefore not defined these operators, and only compare unique_handle
to unique_handle
.
|
inlinenoexcept |
Test for inequality of two handles.
This ignores any deleter instance in the unique_handle.
Inequality is defined in terms of operator=().
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
|
inlinenoexcept |
Test if the first handle is less than the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of std::less
.
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
|
inlinenoexcept |
Test if the first handle is less than or equal to the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of operator<()
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
|
inlinenoexcept |
Test for equality of two handles.
This ignores any deleter instance in the unique_handle.
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
|
inlinenoexcept |
Test if the first handle is greater than the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of operator<()
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |
|
inlinenoexcept |
Test if the first handle is greater than or equal to the second.
This ignores any deleter instance in the unique_handle.
This comparison is defined in terms of operator<()
T | The handle type. |
D | The deleter type. |
kInvalidHandle | The value of an "invalid" handle. |
[in] | h1 | The first unique_handle to compare. |
[in] | h2 | The second unique_handle to compare. |