1
#pragma once
2

            
3
#include "envoy/init/manager.h"
4
#include "envoy/server/factory_context.h"
5
#include "envoy/stats/scope.h"
6

            
7
namespace Envoy {
8
namespace Upstream {
9

            
10
/*
11
 * Upstream Factory Context used by both Clusters and Routers to configure
12
 * upstream HTTP filters.
13
 */
14
class UpstreamFactoryContextImpl : public Server::Configuration::UpstreamFactoryContext {
15
public:
16
  UpstreamFactoryContextImpl(Server::Configuration::ServerFactoryContext& context,
17
                             Init::Manager& init_manager, Stats::Scope& scope)
18
18202
      : server_context_(context), init_manager_(init_manager), scope_(scope) {}
19

            
20
1621
  Server::Configuration::ServerFactoryContext& serverFactoryContext() override {
21
1621
    return server_context_;
22
1621
  }
23

            
24
440
  Init::Manager& initManager() override { return init_manager_; }
25
385
  Stats::Scope& scope() override { return scope_; }
26

            
27
private:
28
  Server::Configuration::ServerFactoryContext& server_context_;
29
  Init::Manager& init_manager_;
30
  Stats::Scope& scope_;
31
};
32

            
33
} // namespace Upstream
34
} // namespace Envoy