13 #include "CallbackStore.h"
14 #include "mockdata/AccelerometerData.h"
22 std::unique_ptr<CallbackStore> RegisterActiveCallback(NotifyCallback callback,
24 auto store = std::make_unique<CallbackStore>(
25 m_index, -1, callback, &HALSIM_CancelAccelerometerActiveCallback);
26 store->SetUid(HALSIM_RegisterAccelerometerActiveCallback(
27 m_index, &CallbackStoreThunk, store.get(), initialNotify));
31 bool GetActive()
const {
return HALSIM_GetAccelerometerActive(m_index); }
33 void SetActive(
bool active) {
34 HALSIM_SetAccelerometerActive(m_index, active);
37 std::unique_ptr<CallbackStore> RegisterRangeCallback(NotifyCallback callback,
39 auto store = std::make_unique<CallbackStore>(
40 m_index, -1, callback, &HALSIM_CancelAccelerometerRangeCallback);
41 store->SetUid(HALSIM_RegisterAccelerometerRangeCallback(
42 m_index, &CallbackStoreThunk, store.get(), initialNotify));
46 HAL_AccelerometerRange GetRange()
const {
47 return HALSIM_GetAccelerometerRange(m_index);
50 void SetRange(HAL_AccelerometerRange range) {
51 HALSIM_SetAccelerometerRange(m_index, range);
54 std::unique_ptr<CallbackStore> RegisterXCallback(NotifyCallback callback,
56 auto store = std::make_unique<CallbackStore>(
57 m_index, -1, callback, &HALSIM_CancelAccelerometerXCallback);
58 store->SetUid(HALSIM_RegisterAccelerometerXCallback(
59 m_index, &CallbackStoreThunk, store.get(), initialNotify));
63 double GetX()
const {
return HALSIM_GetAccelerometerX(m_index); }
65 void SetX(
double x) { HALSIM_SetAccelerometerX(m_index, x); }
67 std::unique_ptr<CallbackStore> RegisterYCallback(NotifyCallback callback,
69 auto store = std::make_unique<CallbackStore>(
70 m_index, -1, callback, &HALSIM_CancelAccelerometerYCallback);
71 store->SetUid(HALSIM_RegisterAccelerometerYCallback(
72 m_index, &CallbackStoreThunk, store.get(), initialNotify));
76 double GetY()
const {
return HALSIM_GetAccelerometerY(m_index); }
78 void SetY(
double y) { HALSIM_SetAccelerometerY(m_index, y); }
80 std::unique_ptr<CallbackStore> RegisterZCallback(NotifyCallback callback,
82 auto store = std::make_unique<CallbackStore>(
83 m_index, -1, callback, &HALSIM_CancelAccelerometerZCallback);
84 store->SetUid(HALSIM_RegisterAccelerometerZCallback(
85 m_index, &CallbackStoreThunk, store.get(), initialNotify));
89 double GetZ()
const {
return HALSIM_GetAccelerometerZ(m_index); }
91 void SetZ(
double z) { HALSIM_SetAccelerometerZ(m_index, z); }
93 void ResetData() { HALSIM_ResetAccelerometerData(m_index); }