Class ReporterRegistrar

Synopsis

#include <include/internal/catch_reporter_registrars.hpp>

template<typename T>
class ReporterRegistrar

Description

No description yet.

Methods

ReporterRegistrar

Source

Lines 16-35 in include/internal/catch_reporter_registrars.hpp.

template<typename T>
class ReporterRegistrar {
    class ReporterFactory : public IReporterFactory {
        IStreamingReporterPtr create( ReporterConfig const& config ) const override {
            return std::unique_ptr<T>( new T( config ) );
        }
        std::string getDescription() const override {
            return T::getDescription();
        }
    };
public:
    explicit ReporterRegistrar( std::string const& name ) {
        getMutableRegistryHub().registerReporter( name, std::make_shared<ReporterFactory>() );
    }
};





Add Discussion as Guest

Log in