1
#pragma once
2

            
3
#include <memory>
4

            
5
#include "envoy/config/core/v3/base.pb.h"
6
#include "envoy/event/dispatcher.h"
7
#include "envoy/singleton/manager.h"
8
#include "envoy/upstream/locality.h"
9

            
10
#include "source/common/shared_pool/shared_pool.h"
11

            
12
namespace Envoy {
13
namespace Upstream {
14

            
15
using ConstLocalitySharedPool =
16
    SharedPool::ObjectSharedPool<const envoy::config::core::v3::Locality, LocalityHash,
17
                                 LocalityEqualTo>;
18
using ConstLocalitySharedPoolSharedPtr = std::shared_ptr<ConstLocalitySharedPool>;
19

            
20
class LocalityPool {
21
public:
22
  /**
23
   * Returns an ObjectSharedPool to store const Locality
24
   * @param manager used to create singleton
25
   * @param dispatcher the dispatcher object reference to the thread that created the
26
   * ObjectSharedPool
27
   */
28
  static ConstLocalitySharedPoolSharedPtr getConstLocalitySharedPool(Singleton::Manager& manager,
29
                                                                     Event::Dispatcher& dispatcher);
30
};
31

            
32
} // namespace Upstream
33
} // namespace Envoy