21#ifndef HEDGEHOG_DEFAULT_NOTIFIER_H
22#define HEDGEHOG_DEFAULT_NOTIFIER_H
26#include "../implementor/implementor_notifier.h"
27#include "../implementor/implementor_slot.h"
28#include "../../abstractions/base/input_output/slot_abstraction.h"
34namespace implementor {
39 std::unique_ptr<std::set<abstraction::SlotAbstraction *>>
const
59 [[nodiscard]] std::set<abstraction::SlotAbstraction *>
const &
connectedSlots()
const override {
return *
slots_; }
63 for (
const auto &slot : *
slots_) { slot->wakeUp(); }
Core's abstraction to receive a signal.
Default concrete implementation of notifier interface.
DefaultNotifier()
Default constructor.
void addSlot(abstraction::SlotAbstraction *const slot) override
Add a slot to transmit messages to.
std::unique_ptr< std::set< abstraction::SlotAbstraction * > > const slots_
Slot getting the message.
void removeSlot(abstraction::SlotAbstraction *const slot) override
Remove a slot to transmit messages to.
std::set< abstraction::SlotAbstraction * > const & connectedSlots() const override
Accessor to the connected slots.
~DefaultNotifier() override=default
Default destructor.
void notify() override
Notify method, calls wakeUp on all connected slots.
void notifyAllTerminated() override
Remove the notifier connection from all connected slots, and calls wakeUp on all.
Implementor for the NotifierAbstraction.
std::unique_ptr< std::set< abstraction::NotifierAbstraction * > > abstractNotifiers_
Set of linked NotifierAbstraction.