blob: ef1e61cecd31d81bb3a93d915869243080c3b872 (
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;
};
|