WPILibC++ 2025.3.1
Loading...
Searching...
No Matches
hal::Handle< CType, FreeFunction, CInvalid > Class Template Reference

A move-only C++ wrapper around a HAL handle. More...

#include <hal/Types.h>

Public Member Functions

 Handle ()=default
 
 Handle (CType val)
 
 Handle (const Handle &)=delete
 
Handleoperator= (const Handle &)=delete
 
 Handle (Handle &&rhs)
 
Handleoperator= (Handle &&rhs)
 
 ~Handle ()
 
 operator CType () const
 

Detailed Description

template<typename CType, void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
class hal::Handle< CType, FreeFunction, CInvalid >

A move-only C++ wrapper around a HAL handle.

Will free the handle if FreeFunction is provided

Constructor & Destructor Documentation

◆ Handle() [1/4]

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
hal::Handle< CType, FreeFunction, CInvalid >::Handle ( )
default

◆ Handle() [2/4]

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
hal::Handle< CType, FreeFunction, CInvalid >::Handle ( CType val)
inline

◆ Handle() [3/4]

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
hal::Handle< CType, FreeFunction, CInvalid >::Handle ( const Handle< CType, FreeFunction, CInvalid > & )
delete

◆ Handle() [4/4]

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
hal::Handle< CType, FreeFunction, CInvalid >::Handle ( Handle< CType, FreeFunction, CInvalid > && rhs)
inline

◆ ~Handle()

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
hal::Handle< CType, FreeFunction, CInvalid >::~Handle ( )
inline

Member Function Documentation

◆ operator CType()

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
hal::Handle< CType, FreeFunction, CInvalid >::operator CType ( ) const
inline

◆ operator=() [1/2]

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
Handle & hal::Handle< CType, FreeFunction, CInvalid >::operator= ( const Handle< CType, FreeFunction, CInvalid > & )
delete

◆ operator=() [2/2]

template<typename CType , void(*)(CType) FreeFunction = nullptr, int32_t CInvalid = HAL_kInvalidHandle>
Handle & hal::Handle< CType, FreeFunction, CInvalid >::operator= ( Handle< CType, FreeFunction, CInvalid > && rhs)
inline

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