#pragma once #include "envoy/compression/decompressor/config.h" namespace Envoy { namespace Extensions { namespace Compression { namespace Common { namespace Decompressor { template class DecompressorLibraryFactoryBase : public Envoy::Compression::Decompressor::NamedDecompressorLibraryConfigFactory { public: Envoy::Compression::Decompressor::DecompressorFactoryPtr createDecompressorFactoryFromProto(const Protobuf::Message& proto_config, Server::Configuration::FactoryContext& context) override { return createDecompressorFactoryFromProtoTyped( MessageUtil::downcastAndValidate(proto_config, context.messageValidationVisitor()), context); } ProtobufTypes::MessagePtr createEmptyConfigProto() override { return std::make_unique(); } std::string name() const override { return name_; } protected: DecompressorLibraryFactoryBase(const std::string& name) : name_(name) {} private: virtual Envoy::Compression::Decompressor::DecompressorFactoryPtr createDecompressorFactoryFromProtoTyped(const ConfigProto& proto_config, Server::Configuration::FactoryContext& context) PURE; const std::string name_; }; } // namespace Decompressor } // namespace Common } // namespace Compression } // namespace Extensions } // namespace Envoy