1
#pragma once
2

            
3
#include "envoy/server/config_tracker.h"
4

            
5
#include "source/common/common/assert.h"
6
#include "source/common/common/macros.h"
7

            
8
namespace Envoy {
9
namespace Server {
10

            
11
/**
12
 * Implementation of ConfigTracker.
13
 */
14
class ConfigTrackerImpl : public ConfigTracker {
15
public:
16
  EntryOwnerPtr add(const std::string& key, Cb cb) override;
17
  const CbsMap& getCallbacksMap() const override;
18

            
19
private:
20
  std::shared_ptr<CbsMap> map_{std::make_shared<CbsMap>()};
21

            
22
  class EntryOwnerImpl : public ConfigTracker::EntryOwner {
23
  public:
24
    EntryOwnerImpl(const std::shared_ptr<CbsMap>& map, const std::string& key);
25
    ~EntryOwnerImpl() override;
26

            
27
  private:
28
    std::shared_ptr<CbsMap> map_;
29
    std::string key_;
30
  };
31
};
32

            
33
} // namespace Server
34
} // namespace Envoy