10#include <initializer_list>
89 const char*
name, int32_t direction,
118 int32_t initialValue) {
138 int64_t initialValue) {
158 double initialValue) {
180 const char*
name, int32_t direction,
182 const char** options,
183 int32_t initialValue);
204 int32_t numOptions,
const char** options,
const double* optionValues,
205 int32_t initialValue);
793 int64_t initialValue) {
809 double initialValue) {
828 std::initializer_list<const char*> options,
829 int32_t initialValue) {
831 const_cast<const char**
>(options.begin()),
850 std::span<const char* const> options,
851 int32_t initialValue) {
853 const_cast<const char**
>(options.data()),
874 std::initializer_list<const char*> options,
875 std::initializer_list<double> optionValues,
876 int32_t initialValue) {
877 if (options.size() != optionValues.size()) {
881 m_handle, name, direction, options.size(),
882 const_cast<const char**
>(options.begin()), optionValues.begin(),
903 std::span<const char* const> options,
904 std::span<const double> optionValues,
905 int32_t initialValue) {
906 if (options.size() != optionValues.size()) {
910 m_handle, name, direction, options.size(),
911 const_cast<const char**
>(options.data()), optionValues.data(),
struct HAL_Value HAL_MakeBoolean(HAL_Bool v)
Definition: Value.h:35
struct HAL_Value HAL_MakeDouble(double v)
Definition: Value.h:63
struct HAL_Value HAL_MakeEnum(int v)
Definition: Value.h:42
struct HAL_Value HAL_MakeInt(int v)
Definition: Value.h:49
struct HAL_Value HAL_MakeLong(int64_t v)
Definition: Value.h:56
@ HAL_DOUBLE
Definition: Value.h:13
@ HAL_LONG
Definition: Value.h:16
@ HAL_ENUM
Definition: Value.h:14
@ HAL_BOOLEAN
Definition: Value.h:12
@ HAL_INT
Definition: Value.h:15
C++ wrapper around a HAL simulator boolean value handle.
Definition: SimDevice.h:608
void Set(bool value)
Sets the simulated value.
Definition: SimDevice.h:636
bool Get() const
Gets the simulated value.
Definition: SimDevice.h:629
SimBoolean()=default
Default constructor that results in an "empty" object that is false in a boolean context.
SimBoolean(HAL_SimValueHandle val)
Wraps a simulated value handle as returned by HAL_CreateSimValueBoolean().
Definition: SimDevice.h:621
A move-only C++ wrapper around a HAL simulator device handle.
Definition: SimDevice.h:642
SimDouble CreateDouble(const char *name, int32_t direction, double initialValue)
Creates a double value on the simulated device.
Definition: SimDevice.h:808
SimLong CreateLong(const char *name, int32_t direction, int64_t initialValue)
Creates a long value on the simulated device.
Definition: SimDevice.h:792
SimDevice & operator=(const SimDevice &)=delete
HAL_SimDeviceHandle m_handle
Definition: SimDevice.h:932
~SimDevice()
Definition: SimDevice.h:707
SimInt CreateInt(const char *name, int32_t direction, int32_t initialValue)
Creates an int value on the simulated device.
Definition: SimDevice.h:777
SimEnum CreateEnum(const char *name, int32_t direction, std::span< const char *const > options, int32_t initialValue)
Creates an enumerated value on the simulated device.
Definition: SimDevice.h:849
SimDevice(const SimDevice &)=delete
SimEnum CreateEnumDouble(const char *name, int32_t direction, std::span< const char *const > options, std::span< const double > optionValues, int32_t initialValue)
Creates an enumerated value on the simulated device with double values.
Definition: SimDevice.h:902
std::string GetName() const
Get the name of the simulated device.
Definition: SimDevice.h:746
SimDevice & operator=(SimDevice &&rhs)
Definition: SimDevice.h:720
SimBoolean CreateBoolean(const char *name, int32_t direction, bool initialValue)
Creates a boolean value on the simulated device.
Definition: SimDevice.h:926
SimDevice(const char *name, int index)
Creates a simulated device.
SimDevice(const char *name)
Creates a simulated device.
Definition: SimDevice.h:672
SimDevice(SimDevice &&rhs)
Definition: SimDevice.h:716
SimEnum CreateEnum(const char *name, int32_t direction, std::initializer_list< const char * > options, int32_t initialValue)
Creates an enumerated value on the simulated device.
Definition: SimDevice.h:827
Direction
Direction of a simulated value (from the perspective of user code).
Definition: SimDevice.h:647
@ kInput
Definition: SimDevice.h:648
@ kBidir
Definition: SimDevice.h:650
@ kOutput
Definition: SimDevice.h:649
SimValue CreateValue(const char *name, int32_t direction, const HAL_Value &initialValue)
Creates a value on the simulated device.
Definition: SimDevice.h:761
SimEnum CreateEnumDouble(const char *name, int32_t direction, std::initializer_list< const char * > options, std::initializer_list< double > optionValues, int32_t initialValue)
Creates an enumerated value on the simulated device with double values.
Definition: SimDevice.h:873
SimDevice()=default
Default constructor that results in an "empty" object that is false in a boolean context.
SimDevice(const char *name, int index, int channel)
Creates a simulated device.
C++ wrapper around a HAL simulator double value handle.
Definition: SimDevice.h:533
void Set(double value)
Sets the simulated value.
Definition: SimDevice.h:561
void Reset()
Resets the simulated value to 0.
Definition: SimDevice.h:568
SimDouble()=default
Default constructor that results in an "empty" object that is false in a boolean context.
SimDouble(HAL_SimValueHandle val)
Wraps a simulated value handle as returned by HAL_CreateSimValueDouble().
Definition: SimDevice.h:546
double Get() const
Gets the simulated value.
Definition: SimDevice.h:554
C++ wrapper around a HAL simulator enum value handle.
Definition: SimDevice.h:574
SimEnum()=default
Default constructor that results in an "empty" object that is false in a boolean context.
int32_t Get() const
Gets the simulated value.
Definition: SimDevice.h:595
void Set(int32_t value)
Sets the simulated value.
Definition: SimDevice.h:602
SimEnum(HAL_SimValueHandle val)
Wraps a simulated value handle as returned by HAL_CreateSimValueEnum().
Definition: SimDevice.h:587
C++ wrapper around a HAL simulator int value handle.
Definition: SimDevice.h:451
SimInt()=default
Default constructor that results in an "empty" object that is false in a boolean context.
void Set(int32_t value)
Sets the simulated value.
Definition: SimDevice.h:479
void Reset()
Resets the simulated value to 0.
Definition: SimDevice.h:486
int32_t Get() const
Gets the simulated value.
Definition: SimDevice.h:472
SimInt(HAL_SimValueHandle val)
Wraps a simulated value handle as returned by HAL_CreateSimValueInt().
Definition: SimDevice.h:464
C++ wrapper around a HAL simulator long value handle.
Definition: SimDevice.h:492
int64_t Get() const
Gets the simulated value.
Definition: SimDevice.h:513
void Reset()
Resets the simulated value to 0.
Definition: SimDevice.h:527
SimLong()=default
Default constructor that results in an "empty" object that is false in a boolean context.
SimLong(HAL_SimValueHandle val)
Wraps a simulated value handle as returned by HAL_CreateSimValueLong().
Definition: SimDevice.h:505
void Set(int64_t value)
Sets the simulated value.
Definition: SimDevice.h:520
C++ wrapper around a HAL simulator value handle.
Definition: SimDevice.h:399
SimValue()=default
Default constructor that results in an "empty" object that is false in a boolean context.
void SetValue(const HAL_Value &value)
Sets the simulated value.
Definition: SimDevice.h:442
HAL_Value GetValue() const
Gets the simulated value.
Definition: SimDevice.h:435
HAL_SimValueHandle m_handle
Definition: SimDevice.h:445
SimValue(HAL_SimValueHandle val)
Wraps a simulated value handle as returned by HAL_CreateSimValue().
Definition: SimDevice.h:412
HAL_SimValueHandle HAL_CreateSimValueEnumDouble(HAL_SimDeviceHandle device, const char *name, int32_t direction, int32_t numOptions, const char **options, const double *optionValues, int32_t initialValue)
Creates an enumerated value on a simulated device with double values.
HAL_SimValueHandle HAL_CreateSimValueInt(HAL_SimDeviceHandle device, const char *name, int32_t direction, int32_t initialValue)
Creates an int value on a simulated device.
Definition: SimDevice.h:115
double HAL_GetSimValueDouble(HAL_SimValueHandle handle)
Gets a simulated value (double).
Definition: SimDevice.h:275
HAL_SimValueHandle HAL_CreateSimValue(HAL_SimDeviceHandle device, const char *name, int32_t direction, const struct HAL_Value *initialValue)
Creates a value on a simulated device.
int32_t HAL_GetSimValueEnum(HAL_SimValueHandle handle)
Gets a simulated value (enum).
Definition: SimDevice.h:287
HAL_SimValueHandle HAL_CreateSimValueBoolean(HAL_SimDeviceHandle device, const char *name, int32_t direction, HAL_Bool initialValue)
Creates a boolean value on a simulated device.
Definition: SimDevice.h:219
void HAL_SetSimValueEnum(HAL_SimValueHandle handle, int32_t value)
Sets a simulated value (enum).
Definition: SimDevice.h:360
void HAL_SetSimValueDouble(HAL_SimValueHandle handle, double value)
Sets a simulated value (double).
Definition: SimDevice.h:349
void HAL_FreeSimDevice(HAL_SimDeviceHandle handle)
Frees a simulated device.
void HAL_SetSimValue(HAL_SimValueHandle handle, const struct HAL_Value *value)
Sets a simulated value.
void HAL_SetSimValueLong(HAL_SimValueHandle handle, int64_t value)
Sets a simulated value (long).
Definition: SimDevice.h:338
HAL_SimDeviceHandle HAL_CreateSimDevice(const char *name)
Creates a simulated device.
HAL_SimValueHandle HAL_CreateSimValueEnum(HAL_SimDeviceHandle device, const char *name, int32_t direction, int32_t numOptions, const char **options, int32_t initialValue)
Creates an enumerated value on a simulated device.
HAL_SimValueHandle HAL_CreateSimValueDouble(HAL_SimDeviceHandle device, const char *name, int32_t direction, double initialValue)
Creates a double value on a simulated device.
Definition: SimDevice.h:155
HAL_SimValueHandle HAL_CreateSimValueLong(HAL_SimDeviceHandle device, const char *name, int32_t direction, int64_t initialValue)
Creates a long value on a simulated device.
Definition: SimDevice.h:135
void HAL_SetSimValueInt(HAL_SimValueHandle handle, int value)
Sets a simulated value (int).
Definition: SimDevice.h:327
HAL_SimValueDirection
Direction of a simulated value (from the perspective of user code).
Definition: SimDevice.h:33
HAL_Bool HAL_GetSimValueBoolean(HAL_SimValueHandle handle)
Gets a simulated value (boolean).
Definition: SimDevice.h:299
void HAL_GetSimValue(HAL_SimValueHandle handle, struct HAL_Value *value)
Gets a simulated value.
int64_t HAL_GetSimValueLong(HAL_SimValueHandle handle)
Gets a simulated value (long).
Definition: SimDevice.h:263
const char * HAL_GetSimDeviceName(HAL_SimDeviceHandle handle)
Get the name of a simulated device.
void HAL_SetSimValueBoolean(HAL_SimValueHandle handle, HAL_Bool value)
Sets a simulated value (boolean).
Definition: SimDevice.h:371
int32_t HAL_GetSimValueInt(HAL_SimValueHandle handle)
Gets a simulated value (int).
Definition: SimDevice.h:251
void HAL_ResetSimValue(HAL_SimValueHandle handle)
Resets a simulated double or integral value to 0.
@ HAL_SimValueBidir
bidirectional between user code and simulator
Definition: SimDevice.h:36
@ HAL_SimValueOutput
output from user code to the simulator
Definition: SimDevice.h:35
@ HAL_SimValueInput
input to user code from the simulator
Definition: SimDevice.h:34
int32_t HAL_Bool
Definition: Types.h:73
HAL_Handle HAL_SimDeviceHandle
Definition: Types.h:53
HAL_Handle HAL_SimValueHandle
Definition: Types.h:55
#define HAL_kInvalidHandle
Definition: Types.h:15
WPILib Hardware Abstraction Layer (HAL) namespace.
Definition: ChipObject.h:40
constexpr const char * name(const T &)
HAL Entry Value.
Definition: Value.h:20
double v_double
Definition: Value.h:26
int64_t v_long
Definition: Value.h:25
HAL_Bool v_boolean
Definition: Value.h:22
int32_t v_int
Definition: Value.h:24
enum HAL_Type type
Definition: Value.h:28
int32_t v_enum
Definition: Value.h:23