From 916f589344e1a2a296f976971cf707466fb435f3 Mon Sep 17 00:00:00 2001 From: Matthew Colvin <35540398+Mc067415@users.noreply.github.com> Date: Mon, 14 Aug 2023 20:04:27 -0500 Subject: [PATCH] Update Notification class to allow for easier reference to the handler type --- Platformio/HAL/Notification.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Platformio/HAL/Notification.hpp b/Platformio/HAL/Notification.hpp index 0cb279c..876c5aa 100644 --- a/Platformio/HAL/Notification.hpp +++ b/Platformio/HAL/Notification.hpp @@ -5,16 +5,18 @@ template class Notification{ public: + typedef std::function HandlerTy; + Notification() = default; - void onNotify(std::function aHandler); + void onNotify(HandlerTy aHandler); void notify(notifyData... notifySendData); private: - std::vector> mFunctionHandlers; + std::vector mFunctionHandlers; }; template -void Notification::onNotify(std::function aHandler){ +void Notification::onNotify(HandlerTy aHandler){ mFunctionHandlers.push_back(std::move(aHandler)); }