From e6644d6b235005de9ba1b9884472fa5f5d8d6074 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 20 Mar 2022 18:49:49 +0100 Subject: refactor: update event system terminology & structure --- src/interfaces/publisher.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/interfaces/publisher.hpp (limited to 'src/interfaces/publisher.hpp') diff --git a/src/interfaces/publisher.hpp b/src/interfaces/publisher.hpp new file mode 100644 index 0000000..14766ed --- /dev/null +++ b/src/interfaces/publisher.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include "interfaces/subscriber.hpp" + +#include +#include + +template +class IPublisher +{ +public: + virtual ~IPublisher() noexcept = default; + + virtual void + subscribe(const Event &event, + const std::shared_ptr> &subscriber) noexcept = 0; + + virtual void notify_subscribers(const Event &event, + const Context &context) const noexcept = 0; +}; -- cgit v1.2.3-18-g5258