10 #ifndef __FRC_ROBORIO__
15 #include "CallbackStore.h"
16 #include "mockdata/RelayData.h"
22 explicit RelaySim(
int index) { m_index = index; }
24 std::unique_ptr<CallbackStore> RegisterInitializedForwardCallback(
25 NotifyCallback callback,
bool initialNotify) {
26 auto store = std::make_unique<CallbackStore>(
27 m_index, -1, callback, &HALSIM_CancelRelayInitializedForwardCallback);
28 store->SetUid(HALSIM_RegisterRelayInitializedForwardCallback(
29 m_index, &CallbackStoreThunk, store.get(), initialNotify));
32 bool GetInitializedForward() {
33 return HALSIM_GetRelayInitializedForward(m_index);
35 void SetInitializedForward(
bool initializedForward) {
36 HALSIM_SetRelayInitializedForward(m_index, initializedForward);
39 std::unique_ptr<CallbackStore> RegisterInitializedReverseCallback(
40 NotifyCallback callback,
bool initialNotify) {
41 auto store = std::make_unique<CallbackStore>(
42 m_index, -1, callback, &HALSIM_CancelRelayInitializedReverseCallback);
43 store->SetUid(HALSIM_RegisterRelayInitializedReverseCallback(
44 m_index, &CallbackStoreThunk, store.get(), initialNotify));
47 bool GetInitializedReverse() {
48 return HALSIM_GetRelayInitializedReverse(m_index);
50 void SetInitializedReverse(
bool initializedReverse) {
51 HALSIM_SetRelayInitializedReverse(m_index, initializedReverse);
54 std::unique_ptr<CallbackStore> RegisterForwardCallback(
55 NotifyCallback callback,
bool initialNotify) {
56 auto store = std::make_unique<CallbackStore>(
57 m_index, -1, callback, &HALSIM_CancelRelayForwardCallback);
58 store->SetUid(HALSIM_RegisterRelayForwardCallback(
59 m_index, &CallbackStoreThunk, store.get(), initialNotify));
62 bool GetForward() {
return HALSIM_GetRelayForward(m_index); }
63 void SetForward(
bool forward) { HALSIM_SetRelayForward(m_index, forward); }
65 std::unique_ptr<CallbackStore> RegisterReverseCallback(
66 NotifyCallback callback,
bool initialNotify) {
67 auto store = std::make_unique<CallbackStore>(
68 m_index, -1, callback, &HALSIM_CancelRelayReverseCallback);
69 store->SetUid(HALSIM_RegisterRelayReverseCallback(
70 m_index, &CallbackStoreThunk, store.get(), initialNotify));
73 bool GetReverse() {
return HALSIM_GetRelayReverse(m_index); }
74 void SetReverse(
bool reverse) { HALSIM_SetRelayReverse(m_index, reverse); }
76 void ResetData() { HALSIM_ResetRelayData(m_index); }
83 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: RelaySim.h:20