aboutsummaryrefslogtreecommitdiffstats
path: root/slobrok/src/vespa/slobrok/server/proxy_map_source.h
blob: 94902c966afd3b779aaf93b1ed1d202bf1866c82 (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.

#pragma once

#include "map_source.h"
#include <set>

namespace slobrok {

/**
 * Proof-of-concept implementation of MapSource broadcasting.
 **/
class ProxyMapSource : public MapSource, public MapListener {
    std::set<MapListener *> _listeners;
    void registerListener(MapListener &listener) override;
    void unregisterListener(MapListener &listener) override;
public:
    ProxyMapSource();
     ~ProxyMapSource();

    void add(const ServiceMapping &mapping) override;
    void remove(const ServiceMapping &mapping) override;
    void update(const ServiceMapping &old_mapping,
                const ServiceMapping &new_mapping) override;
};

} // namespace slobrok