WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
hal::UnlimitedHandleResource< THandle, TStruct, enumValue > Class Template Reference

The UnlimitedHandleResource class is a way to track handles. More...

#include <UnlimitedHandleResource.h>

Public Member Functions

 UnlimitedHandleResource (const UnlimitedHandleResource &)=delete
 
UnlimitedHandleResource operator= (const UnlimitedHandleResource &)=delete
 
THandle Allocate (std::shared_ptr< TStruct > structure)
 
std::shared_ptr< TStruct > Get (THandle handle)
 
void Free (THandle handle)
 

Friends

class UnlimitedHandleResourceTest
 

Detailed Description

template<typename THandle, typename TStruct, HAL_HandleEnum enumValue>
class hal::UnlimitedHandleResource< THandle, TStruct, enumValue >

The UnlimitedHandleResource class is a way to track handles.

This version allows an unlimted number of handles that are allocated sequentially. When possible, indices are reused to save memory usage and keep the array length down. However, automatic array management has not been implemented, but might be in the future. Because we have to loop through the allocator, we must use a global mutex.

Template Parameters
THandleThe Handle Type (Must be typedefed from HAL_Handle)
TStructThe struct type held by this resource
enumValueThe type value stored in the handle

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