WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
hal::IndexedClassedHandleResource< THandle, TStruct, size, enumValue > Class Template Reference

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

#include <IndexedClassedHandleResource.h>

Inheritance diagram for hal::IndexedClassedHandleResource< THandle, TStruct, size, enumValue >:
hal::HandleBase

Public Member Functions

 IndexedClassedHandleResource (const IndexedClassedHandleResource &)=delete
 
IndexedClassedHandleResourceoperator= (const IndexedClassedHandleResource &)=delete
 
THandle Allocate (int16_t index, std::shared_ptr< TStruct > toSet, int32_t *status)
 
std::shared_ptr< TStruct > Get (THandle handle)
 
void Free (THandle handle)
 
void ResetHandles ()
 
- Public Member Functions inherited from hal::HandleBase
 HandleBase (const HandleBase &)=delete
 
HandleBaseoperator= (const HandleBase &)=delete
 

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
 

Detailed Description

template<typename THandle, typename TStruct, int16_t size, HAL_HandleEnum enumValue>
class hal::IndexedClassedHandleResource< THandle, TStruct, size, enumValue >

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.]

Template Parameters
THandleThe Handle Type (Must be typedefed from HAL_Handle)
TStructThe struct type held by this resource
sizeThe number of resources allowed to be allocated
enumValueThe type value stored in the handle

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