13 #include "CallbackStore.h"
14 #include "mockdata/RelayData.h"
20 explicit RelaySim(
int index) { m_index = index; }
22 std::unique_ptr<CallbackStore> RegisterInitializedForwardCallback(
23 NotifyCallback callback,
bool initialNotify) {
24 auto store = std::make_unique<CallbackStore>(
25 m_index, -1, callback, &HALSIM_CancelRelayInitializedForwardCallback);
26 store->SetUid(HALSIM_RegisterRelayInitializedForwardCallback(
27 m_index, &CallbackStoreThunk, store.get(), initialNotify));
31 bool GetInitializedForward()
const {
32 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));
48 bool GetInitializedReverse()
const {
49 return HALSIM_GetRelayInitializedReverse(m_index);
52 void SetInitializedReverse(
bool initializedReverse) {
53 HALSIM_SetRelayInitializedReverse(m_index, initializedReverse);
56 std::unique_ptr<CallbackStore> RegisterForwardCallback(
57 NotifyCallback callback,
bool initialNotify) {
58 auto store = std::make_unique<CallbackStore>(
59 m_index, -1, callback, &HALSIM_CancelRelayForwardCallback);
60 store->SetUid(HALSIM_RegisterRelayForwardCallback(
61 m_index, &CallbackStoreThunk, store.get(), initialNotify));
65 bool GetForward()
const {
return HALSIM_GetRelayForward(m_index); }
67 void SetForward(
bool forward) { HALSIM_SetRelayForward(m_index, forward); }
69 std::unique_ptr<CallbackStore> RegisterReverseCallback(
70 NotifyCallback callback,
bool initialNotify) {
71 auto store = std::make_unique<CallbackStore>(
72 m_index, -1, callback, &HALSIM_CancelRelayReverseCallback);
73 store->SetUid(HALSIM_RegisterRelayReverseCallback(
74 m_index, &CallbackStoreThunk, store.get(), initialNotify));
78 bool GetReverse()
const {
return HALSIM_GetRelayReverse(m_index); }
80 void SetReverse(
bool reverse) { HALSIM_SetRelayReverse(m_index, reverse); }
82 void ResetData() { HALSIM_ResetRelayData(m_index); }