WPILibC++ 2023.4.3-108-ge5452e3
|
The IndexedClassedHandleResource class is a way to track handles. More...
#include <hal/handles/IndexedClassedHandleResource.h>
Public Member Functions | |
IndexedClassedHandleResource ()=default | |
IndexedClassedHandleResource (const IndexedClassedHandleResource &)=delete | |
IndexedClassedHandleResource & | operator= (const IndexedClassedHandleResource &)=delete |
THandle | Allocate (int16_t index, std::shared_ptr< TStruct > toSet, int32_t *status) |
int16_t | GetIndex (THandle handle) |
std::shared_ptr< TStruct > | Get (THandle handle) |
void | Free (THandle handle) |
void | ResetHandles () override |
Public Member Functions inherited from hal::HandleBase | |
HandleBase () | |
~HandleBase () | |
HandleBase (const HandleBase &)=delete | |
HandleBase & | operator= (const HandleBase &)=delete |
virtual void | ResetHandles () |
Friends | |
class | IndexedClassedHandleResourceTest |
Additional Inherited Members | |
Static Public Member Functions inherited from hal::HandleBase | |
static void | ResetGlobalHandles () |
Protected Attributes inherited from hal::HandleBase | |
int16_t | m_version |
The IndexedClassedHandleResource class is a way to track handles.
This version allows a limited number of handles that are allocated by index. Because they are allocated by index, each individual index holds its own mutex, which reduces contention heavily.]
THandle | The Handle Type (Must be typedefed from HAL_Handle) |
TStruct | The struct type held by this resource |
size | The number of resources allowed to be allocated |
enumValue | The type value stored in the handle |
|
default |
|
delete |
THandle hal::IndexedClassedHandleResource< THandle, TStruct, size, enumValue >::Allocate | ( | int16_t | index, |
std::shared_ptr< TStruct > | toSet, | ||
int32_t * | status | ||
) |
void hal::IndexedClassedHandleResource< THandle, TStruct, size, enumValue >::Free | ( | THandle | handle | ) |
std::shared_ptr< TStruct > hal::IndexedClassedHandleResource< THandle, TStruct, size, enumValue >::Get | ( | THandle | handle | ) |
|
inline |
|
delete |
|
overridevirtual |
Reimplemented from hal::HandleBase.
|
friend |