7 auto it = std::find_if(
m_hooks.begin(),
m_hooks.end(), [hook](
const auto& h) { return h.get() == hook; });
23 hook->onPresetLoad(request, response);
38 hook->onKwidgetLoad(request, response);
bool removeHook(PresetEventHook *hook)
Removes a hook from the middleware.
Definition PresetEventMiddleware.cpp:5
void addHook(std::unique_ptr< PresetEventHook > hook)
Adds a new hook to the middleware.
Definition PresetEventMiddleware.cpp:3
KwidgetLoadResponse processKwidgetLoad(KwidgetLoadRequest &request)
Processes a Kwidget load request through all registered hooks.
Definition PresetEventMiddleware.cpp:33
PresetLoadResponse processPresetLoad(PresetLoadRequest &request)
Processes a preset load request through all registered hooks.
Definition PresetEventMiddleware.cpp:18
std::vector< std::unique_ptr< PresetEventHook > > m_hooks
Definition PresetEventMiddleware.h:131
Definition AirAbsorptionFilter.cpp:2
An abstract base class for preset event hooks. These can be used to intercept and modify preset and K...
Definition PresetEventMiddleware.h:65
A middleware request object for a preset load event.
Definition PresetEventMiddleware.h:7
A simple middleware response object containing the success status and a message.
Definition PresetEventMiddleware.h:19
bool success
Indicates whether the middleware was successful in processing the preset load request,...
Definition PresetEventMiddleware.h:24