blob: 4e66d64e0ebaf0f3fadb88d83a5c562435291a06 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#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;
};
|