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));
33 bool GetInitializedForward()
const {
34 return HALSIM_GetRelayInitializedForward(m_index);
37 void SetInitializedForward(
bool initializedForward) {
38 HALSIM_SetRelayInitializedForward(m_index, initializedForward);
41 std::unique_ptr<CallbackStore> RegisterInitializedReverseCallback(
42 NotifyCallback callback,
bool initialNotify) {
43 auto store = std::make_unique<CallbackStore>(
44 m_index, -1, callback, &HALSIM_CancelRelayInitializedReverseCallback);
45 store->SetUid(HALSIM_RegisterRelayInitializedReverseCallback(
46 m_index, &CallbackStoreThunk, store.get(), initialNotify));
50 bool GetInitializedReverse()
const {
51 return HALSIM_GetRelayInitializedReverse(m_index);
54 void SetInitializedReverse(
bool initializedReverse) {
55 HALSIM_SetRelayInitializedReverse(m_index, initializedReverse);
58 std::unique_ptr<CallbackStore> RegisterForwardCallback(
59 NotifyCallback callback,
bool initialNotify) {
60 auto store = std::make_unique<CallbackStore>(
61 m_index, -1, callback, &HALSIM_CancelRelayForwardCallback);
62 store->SetUid(HALSIM_RegisterRelayForwardCallback(
63 m_index, &CallbackStoreThunk, store.get(), initialNotify));
67 bool GetForward()
const {
return HALSIM_GetRelayForward(m_index); }
69 void SetForward(
bool forward) { HALSIM_SetRelayForward(m_index, forward); }
71 std::unique_ptr<CallbackStore> RegisterReverseCallback(
72 NotifyCallback callback,
bool initialNotify) {
73 auto store = std::make_unique<CallbackStore>(
74 m_index, -1, callback, &HALSIM_CancelRelayReverseCallback);
75 store->SetUid(HALSIM_RegisterRelayReverseCallback(
76 m_index, &CallbackStoreThunk, store.get(), initialNotify));
80 bool GetReverse()
const {
return HALSIM_GetRelayReverse(m_index); }
82 void SetReverse(
bool reverse) { HALSIM_SetRelayReverse(m_index, reverse); }
84 void ResetData() { HALSIM_ResetRelayData(m_index); }
91 #endif // __FRC_ROBORIO__
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
Definition: RelaySim.h:20