WPILibC++ 2024.3.2
hal::SimDataValue< T, MakeValue, GetName, GetDefault > Class Template Referencefinal

Simulation data value wrapper. More...

#include <hal/simulation/SimDataValue.h>

Inheritance diagram for hal::SimDataValue< T, MakeValue, GetName, GetDefault >:
hal::impl::SimDataValueBase< T, MakeValue > hal::impl::SimCallbackRegistryBase

Public Member Functions

 SimDataValue ()
 
 SimDataValue (T value)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE int32_t RegisterCallback (HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE void Set (T value)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE SimDataValueoperator= (T value)
 
- Public Member Functions inherited from hal::impl::SimDataValueBase< T, MakeValue >
 SimDataValueBase (T value)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE void CancelCallback (int32_t uid)
 
Get () const
 
LLVM_ATTRIBUTE_ALWAYS_INLINE operator T () const
 
void Reset (T value)
 
wpi::recursive_spinlockGetMutex ()
 

Additional Inherited Members

- Protected Types inherited from hal::impl::SimCallbackRegistryBase
using CallbackVector = wpi::UidVector< HalCallbackListener< RawFunctor >, 4 >
 
using RawFunctor = void(*)()
 
- Protected Member Functions inherited from hal::impl::SimDataValueBase< T, MakeValue >
int32_t DoRegisterCallback (HAL_NotifyCallback callback, void *param, HAL_Bool initialNotify, const char *name)
 
void DoSet (T value, const char *name)
 
- Protected Member Functions inherited from hal::impl::SimCallbackRegistryBase
int32_t DoRegister (RawFunctor callback, void *param)
 
LLVM_ATTRIBUTE_ALWAYS_INLINE void DoReset ()
 
void Cancel (int32_t uid)
 
void Reset ()
 
wpi::recursive_spinlockGetMutex ()
 
- Protected Attributes inherited from hal::impl::SimDataValueBase< T, MakeValue >
m_value
 
- Protected Attributes inherited from hal::impl::SimCallbackRegistryBase
wpi::recursive_spinlock m_mutex
 
std::unique_ptr< CallbackVectorm_callbacks
 

Detailed Description

template<typename T, HAL_Value(*)(T) MakeValue, const char *(*)() GetName, T(*)() GetDefault = nullptr>
class hal::SimDataValue< T, MakeValue, GetName, GetDefault >

Simulation data value wrapper.

Provides callback functionality when the data value is changed.

Template Parameters
Tvalue type (e.g. double)
MakeValuefunction that takes a T and returns a HAL_Value
GetNamefunction that returns a const char* for the name
GetDefaultfunction that returns the default T (used only for default constructor)

Constructor & Destructor Documentation

◆ SimDataValue() [1/2]

template<typename T , HAL_Value(*)(T) MakeValue, const char *(*)() GetName, T(*)() GetDefault = nullptr>
hal::SimDataValue< T, MakeValue, GetName, GetDefault >::SimDataValue ( )
inline

◆ SimDataValue() [2/2]

template<typename T , HAL_Value(*)(T) MakeValue, const char *(*)() GetName, T(*)() GetDefault = nullptr>
hal::SimDataValue< T, MakeValue, GetName, GetDefault >::SimDataValue ( value)
inlineexplicit

Member Function Documentation

◆ operator=()

template<typename T , HAL_Value(*)(T) MakeValue, const char *(*)() GetName, T(*)() GetDefault = nullptr>
LLVM_ATTRIBUTE_ALWAYS_INLINE SimDataValue & hal::SimDataValue< T, MakeValue, GetName, GetDefault >::operator= ( value)
inline

◆ RegisterCallback()

template<typename T , HAL_Value(*)(T) MakeValue, const char *(*)() GetName, T(*)() GetDefault = nullptr>
LLVM_ATTRIBUTE_ALWAYS_INLINE int32_t hal::SimDataValue< T, MakeValue, GetName, GetDefault >::RegisterCallback ( HAL_NotifyCallback  callback,
void *  param,
HAL_Bool  initialNotify 
)
inline

◆ Set()

template<typename T , HAL_Value(*)(T) MakeValue, const char *(*)() GetName, T(*)() GetDefault = nullptr>
LLVM_ATTRIBUTE_ALWAYS_INLINE void hal::SimDataValue< T, MakeValue, GetName, GetDefault >::Set ( value)
inline

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