aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/publisher.hpp
blob: 14766ed5f55f1e0eb7417a816a930007335bbdf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include "interfaces/subscriber.hpp"

#include <functional>
#include <memory>

template <typename Event, typename Context>
class IPublisher
{
public:
	virtual ~IPublisher() noexcept = default;

	virtual void
	subscribe(const Event &event,
			  const std::shared_ptr<ISubscriber<Context>> &subscriber) noexcept = 0;

	virtual void notify_subscribers(const Event &event,
									const Context &context) const noexcept = 0;
};