blob: fe70d3fcf0e58a32715c953178639432473c0424 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "i_gid_to_lid_change_handler.h"
namespace proton {
/*
* Helper class for registering listeners that get notification when
* gid to lid mapping changes. Will also unregister stale listeners for
* same doctype.
*/
class GidToLidChangeRegistrator
{
std::shared_ptr<IGidToLidChangeHandler> _handler;
vespalib::string _docTypeName;
std::set<vespalib::string> _keepNames;
public:
GidToLidChangeRegistrator(std::shared_ptr<IGidToLidChangeHandler> handler,
const vespalib::string &docTypeName);
~GidToLidChangeRegistrator();
void addListener(std::unique_ptr<IGidToLidChangeListener> listener);
};
} // namespace proton
|