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

#include "interfaces/subscriber.hpp"

#include <functional>
#include <memory>

template <typename Event, typename Context>
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
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;
};