10 #ifndef __FRC_ROBORIO__
14 #include "mockdata/NotifyListenerVector.h"
16 template <
typename VectorType,
typename CallbackType>
17 std::shared_ptr<VectorType> RegisterCallbackImpl(
18 std::shared_ptr<VectorType> currentVector,
const char* name,
19 CallbackType callback,
void* param, int32_t* newUid) {
20 std::shared_ptr<VectorType> newCallbacks;
21 if (currentVector ==
nullptr) {
22 newCallbacks = std::make_shared<VectorType>(
23 param, callback,
reinterpret_cast<unsigned int*
>(newUid));
25 newCallbacks = currentVector->emplace_back(
26 param, callback, reinterpret_cast<unsigned int*>(newUid));
31 template <
typename VectorType,
typename CallbackType>
32 std::shared_ptr<VectorType> CancelCallbackImpl(
33 std::shared_ptr<VectorType> currentVector, int32_t uid) {
35 auto newCallbacks = currentVector->erase(uid);
39 std::shared_ptr<hal::NotifyListenerVector> RegisterCallback(
40 std::shared_ptr<hal::NotifyListenerVector> currentVector,
const char* name,
41 HAL_NotifyCallback callback,
void* param, int32_t* newUid);
43 std::shared_ptr<hal::NotifyListenerVector> CancelCallback(
44 std::shared_ptr<hal::NotifyListenerVector> currentVector, int32_t uid);
46 void InvokeCallback(std::shared_ptr<hal::NotifyListenerVector> currentVector,
47 const char* name,
const HAL_Value* value);
49 std::shared_ptr<hal::BufferListenerVector> RegisterCallback(
50 std::shared_ptr<hal::BufferListenerVector> currentVector,
const char* name,
51 HAL_BufferCallback callback,
void* param, int32_t* newUid);
53 std::shared_ptr<hal::BufferListenerVector> CancelCallback(
54 std::shared_ptr<hal::BufferListenerVector> currentVector, int32_t uid);
56 void InvokeCallback(std::shared_ptr<hal::BufferListenerVector> currentVector,
57 const char* name, uint8_t* buffer, int32_t count);
59 std::shared_ptr<hal::ConstBufferListenerVector> RegisterCallback(
60 std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
61 const char* name, HAL_ConstBufferCallback callback,
void* param,
64 std::shared_ptr<hal::ConstBufferListenerVector> CancelCallback(
65 std::shared_ptr<hal::ConstBufferListenerVector> currentVector, int32_t uid);
68 std::shared_ptr<hal::ConstBufferListenerVector> currentVector,
69 const char* name,
const uint8_t* buffer, int32_t count);
HAL Entry Value.
Definition: HAL_Value.h:25