RADPx-OS Kernel (Radical Posix OS)  Crimson 0.1.4
POSIX-inspired kernel API with embedded and desktop VM targets
rad::UniqueHandle< Handle, CloseFn > Class Template Reference

Move-only RAII owner for nullable RADPx-OS handles. More...

#include <rad_cpp.h>

Public Member Functions

constexpr UniqueHandle ()=default
 Create an empty owner.
 
constexpr UniqueHandle (Handle handle)
 Take ownership of handle.
 
 ~UniqueHandle ()
 Close the owned handle if present.
 
 UniqueHandle (const UniqueHandle &)=delete
 
UniqueHandleoperator= (const UniqueHandle &)=delete
 
 UniqueHandle (UniqueHandle &&other) noexcept
 Move ownership from another handle owner.
 
UniqueHandleoperator= (UniqueHandle &&other) noexcept
 Replace this owner with another owner's handle.
 
constexpr Handle get () const
 Return the raw handle without releasing ownership.
 
constexpr operator bool () const
 Return true when a handle is owned.
 
Handle release ()
 Release ownership and return the raw handle.
 
void reset (Handle handle=nullptr)
 Close any current handle and optionally take a replacement.
 

Detailed Description

template<typename Handle, void(*)(Handle) CloseFn>
class rad::UniqueHandle< Handle, CloseFn >

Move-only RAII owner for nullable RADPx-OS handles.


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