Repository: envoyproxy/envoy
File: envoy/upstream/upstream.h (C/C++)

Code before:
  ALL_CLUSTER_CIRCUIT_BREAKERS_STATS(c, GENERATE_GAUGE_STRUCT, h, tr, GENERATE_STATNAME_STRUCT)
};

using ClusterRequestResponseSizeStatsPtr = std::unique_ptr<ClusterRequestResponseSizeStats>;
using ClusterRequestResponseSizeStatsOptRef =
    absl::optional<std::reference_wrapper<ClusterRequestResponseSizeStats>>;

using ClusterTimeoutBudgetStatsPtr = std::unique_ptr<ClusterTimeoutBudgetStats>;
using ClusterTimeoutBudgetStatsOptRef =
    absl::optional<std::reference_wrapper<ClusterTimeoutBudgetStats>>;

/**
 * All extension protocol specific options returned by the method at
 *   NamedNetworkFilterConfigFactory::createProtocolOptions
 * must be derived from this class.
 */
class ProtocolOptionsConfig {
public:
  virtual ~ProtocolOptionsConfig() = default;
};
using ProtocolOptionsConfigConstSharedPtr = std::shared_ptr<const ProtocolOptionsConfig>;

/**
 * Interface describing HTTP protocol options exposed by a cluster.
 */
class HttpProtocolOptionsConfig : public ProtocolOptionsConfig {
public:
  ~HttpProtocolOptionsConfig() override = default;

  virtual const Http::Http1Settings& http1Settings() const PURE;
  virtual const envoy::config::core::v3::Http2ProtocolOptions& http2Options() const PURE;
  virtual const envoy::config::core::v3::Http3ProtocolOptions& http3Options() const PURE;
  virtual const envoy::config::core::v3::HttpProtocolOptions&
  commonHttpProtocolOptions() const PURE;
  virtual const absl::optional<envoy::config::core::v3::UpstreamHttpProtocolOptions>&
  upstreamHttpProtocolOptions() const PURE;
  virtual const absl::optional<const envoy::config::core::v3::AlternateProtocolsCacheOptions>&
  alternateProtocolsCacheOptions() const PURE;
  virtual const std::vector<Router::ShadowPolicyPtr>& shadowPolicies() const PURE;
  virtual const Router::RetryPolicy* retryPolicy() const PURE;
  virtual const Http::HashPolicy* hashPolicy() const PURE;
};

using HttpProtocolOptionsConfigConstSharedPtr = std::shared_ptr<const HttpProtocolOptionsConfig>;

/**
 *  Base class for all cluster typed metadata factory.
 */
class ClusterTypedMetadataFactory : public Envoy::Config::TypedMetadataFactory {};

class LoadBalancerConfig;

Review comment (suggestion):
Can you carry over the comments that were present above the methods. Since this is an interface, it should be well documented, IMO.

Code after:
  ALL_CLUSTER_CIRCUIT_BREAKERS_STATS(c, GENERATE_GAUGE_STRUCT, h, tr, GENERATE_STATNAME_STRUCT)
};

using ClusterRequestResponseSizeStatsPtr = std::unique_ptr<ClusterRequestResponseSizeStats>;
using ClusterRequestResponseSizeStatsOptRef =
    absl::optional<std::reference_wrapper<ClusterRequestResponseSizeStats>>;

using ClusterTimeoutBudgetStatsPtr = std::unique_ptr<ClusterTimeoutBudgetStats>;
using ClusterTimeoutBudgetStatsOptRef =
    absl::optional<std::reference_wrapper<ClusterTimeoutBudgetStats>>;

/**
 * All extension protocol specific options returned by the method at
 *   NamedNetworkFilterConfigFactory::createProtocolOptions
 * must be derived from this class.
 */
class ProtocolOptionsConfig {
public:
  virtual ~ProtocolOptionsConfig() = default;
};
using ProtocolOptionsConfigConstSharedPtr = std::shared_ptr<const ProtocolOptionsConfig>;

/**
 * Interface describing HTTP protocol options exposed by a cluster.
 */
class HttpProtocolOptionsConfig : public ProtocolOptionsConfig {
public:
  ~HttpProtocolOptionsConfig() override = default;

  /**
   * @return const Http::Http1Settings& the HTTP/1.1 settings for upstream connections.
   */
  virtual const Http::Http1Settings& http1Settings() const PURE;

  /**
   * @return const envoy::config::core::v3::Http2ProtocolOptions& the HTTP/2 protocol options for
   *         upstream connections.
   */
  virtual const envoy::config::core::v3::Http2ProtocolOptions& http2Options() const PURE;

  /**
   * @return const envoy::config::core::v3::Http3ProtocolOptions& the HTTP/3 protocol options for
   *         upstream connections.
   */
  virtual const envoy::config::core::v3::Http3ProtocolOptions& http3Options() const PURE;

  /**
   * @return const envoy::config::core::v3::HttpProtocolOptions& the common HTTP protocol options
   *         that apply to all HTTP versions for upstream connections.
   */
  virtual const envoy::config::core::v3::HttpProtocolOptions&