|
PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
Declare an RAII container for sharing system API handles (psystem::shared_handle). More...
#include "platform.hpp"#include <atomic>#include "default_close_handle.hpp"#include "stack_allocated.hpp"#include "unique_handle.hpp"

Go to the source code of this file.
Classes | |
| class | psystem::shared_handle< T, kInvalidHandle > |
| Share management of a single "handle" between multiple owners. More... | |
| struct | psystem::shared_handle< T, kInvalidHandle >::shared_handle_data |
| The basic control block for a shared_handle. More... | |
| struct | psystem::shared_handle< T, kInvalidHandle >::shared_handle_data_with_delete< D > |
| A control block for a shared_handle with a user-specified deleter. More... | |
| struct | std::hash< psystem::shared_handle< T, kInvalidHandle > > |
Forward the hash functor along to the underlying handle type for psystem::shared_handle. More... | |
Namespaces | |
| psystem | |
| Contains the process examination "system" and basic frameworks. | |
Functions | |
| template<typename T , T kInvalidHandle> | |
| void | std::swap (psystem::shared_handle< T, kInvalidHandle > &o1, psystem::shared_handle< T, kInvalidHandle > &o2) noexcept |
Delegate std::swap calls for shared_handle to the member function. More... | |
| template<typename T , T kInvalidHandle> | |
| bool | operator== (psystem::shared_handle< T, kInvalidHandle > const &h1, psystem::shared_handle< T, kInvalidHandle > const &h2) noexcept |
| Test for equality of two handles. More... | |
| template<typename T , T kInvalidHandle> | |
| bool | operator!= (psystem::shared_handle< T, kInvalidHandle > const &h1, psystem::shared_handle< T, kInvalidHandle > const &h2) noexcept |
| Test for inequality of two handles. More... | |
| template<typename T , T kInvalidHandle> | |
| bool | operator< (psystem::shared_handle< T, kInvalidHandle > const &h1, psystem::shared_handle< T, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is less than the second. More... | |
| template<typename T , T kInvalidHandle> | |
| bool | operator<= (psystem::shared_handle< T, kInvalidHandle > const &h1, psystem::shared_handle< T, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is less than or equal to the second. More... | |
| template<typename T , T kInvalidHandle> | |
| bool | operator> (psystem::shared_handle< T, kInvalidHandle > const &h1, psystem::shared_handle< T, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is greater than the second. More... | |
| template<typename T , T kInvalidHandle> | |
| bool | operator>= (psystem::shared_handle< T, kInvalidHandle > const &h1, psystem::shared_handle< T, kInvalidHandle > const &h2) noexcept |
| Test if the first handle is greater than or equal to the second. More... | |
Declare an RAII container for sharing system API handles (psystem::shared_handle).
shared_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 "shared_handle(hndl) == hndl" may first convert the shared_handle to a bool, then use a simple equality operator that compares POD integers, or it call the operator== that takes shared_handle and the handle type. There is ambiguity. We will therefore not defined these operators, and only compare shared_handle to shared_handle.
|
inlinenoexcept |
Test for inequality of two handles.
This ignores any deleter instance in the shared_handle.
Inequality is defined in terms of operator=().
| T | The handle type. |
| kInvalidHandle | The value of an "invalid" handle. |
| [in] | h1 | The first shared_handle to compare. |
| [in] | h2 | The second shared_handle to compare. |
|
inlinenoexcept |
Test if the first handle is less than the second.
This ignores any deleter instance in the shared_handle.
This comparison is defined in terms of std::less.
| T | The handle type. |
| kInvalidHandle | The value of an "invalid" handle. |
| [in] | h1 | The first shared_handle to compare. |
| [in] | h2 | The second shared_handle to compare. |
|
inlinenoexcept |
Test if the first handle is less than or equal to the second.
This ignores any deleter instance in the shared_handle.
This comparison is defined in terms of operator<()
| T | The handle type. |
| kInvalidHandle | The value of an "invalid" handle. |
| [in] | h1 | The first shared_handle to compare. |
| [in] | h2 | The second shared_handle to compare. |
|
inlinenoexcept |
Test for equality of two handles.
This ignores any deleter instance in the shared_handle.
| T | The handle type. |
| kInvalidHandle | The value of an "invalid" handle. |
| [in] | h1 | The first shared_handle to compare. |
| [in] | h2 | The second shared_handle to compare. |
|
inlinenoexcept |
Test if the first handle is greater than the second.
This ignores any deleter instance in the shared_handle.
This comparison is defined in terms of operator<()
| T | The handle type. |
| kInvalidHandle | The value of an "invalid" handle. |
| [in] | h1 | The first shared_handle to compare. |
| [in] | h2 | The second shared_handle to compare. |
|
inlinenoexcept |
Test if the first handle is greater than or equal to the second.
This ignores any deleter instance in the shared_handle.
This comparison is defined in terms of operator<()
| T | The handle type. |
| kInvalidHandle | The value of an "invalid" handle. |
| [in] | h1 | The first shared_handle to compare. |
| [in] | h2 | The second shared_handle to compare. |