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

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

#include <DigitalHandleResource.h>

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

Public Member Functions

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

Friends

class DigitalHandleResourceTest
 

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>
class hal::DigitalHandleResource< THandle, TStruct, size >

The DigitalHandleResource class is a way to track handles.

This version allows a limited number of handles that are allocated by index. The enum value is seperate, as 2 enum values are allowed per handle 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

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