WPILibC++ 2023.4.3-108-ge5452e3
|
C++ wrapper around a HAL simulator long value handle. More...
#include <hal/SimDevice.h>
Public Member Functions | |
SimLong ()=default | |
Default constructor that results in an "empty" object that is false in a boolean context. More... | |
SimLong (HAL_SimValueHandle val) | |
Wraps a simulated value handle as returned by HAL_CreateSimValueLong(). More... | |
int64_t | Get () const |
Gets the simulated value. More... | |
void | Set (int64_t value) |
Sets the simulated value. More... | |
void | Reset () |
Resets the simulated value to 0. More... | |
Public Member Functions inherited from hal::SimValue | |
SimValue ()=default | |
Default constructor that results in an "empty" object that is false in a boolean context. More... | |
SimValue (HAL_SimValueHandle val) | |
Wraps a simulated value handle as returned by HAL_CreateSimValue(). More... | |
operator bool () const | |
Determine if handle is empty. More... | |
operator HAL_SimValueHandle () const | |
Get the internal device handle. More... | |
HAL_Value | GetValue () const |
Gets the simulated value. More... | |
void | SetValue (const HAL_Value &value) |
Sets the simulated value. More... | |
Additional Inherited Members | |
Protected Attributes inherited from hal::SimValue | |
HAL_SimValueHandle | m_handle = HAL_kInvalidHandle |
C++ wrapper around a HAL simulator long value handle.
|
default |
Default constructor that results in an "empty" object that is false in a boolean context.
|
inline |
Wraps a simulated value handle as returned by HAL_CreateSimValueLong().
val | simulated value handle |
|
inline |
Gets the simulated value.
|
inline |
Resets the simulated value to 0.
Use this instead of Set(0) for resetting incremental sensor values like encoder counts or gyro accumulated angle to ensure correct behavior in a distributed system (e.g. WebSockets).
|
inline |
Sets the simulated value.
value | the value to set |