blob: db772f0acbf73c7863ab5d2c4414eb060c79f625 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "map_source.h"
namespace slobrok {
MapSubscription::MapSubscription(MapSource &source, MapListener &listener, Tag)
: _source(source), _listener(listener)
{
_source.registerListener(_listener);
}
MapSubscription::~MapSubscription() {
_source.unregisterListener(_listener);
}
std::unique_ptr<MapSubscription>
MapSubscription::subscribe(MapSource &source, MapListener &listener)
{
return std::make_unique<MapSubscription>(source, listener, Tag{});
}
MapSource::~MapSource() = default;
} // namespace slobrok
|