File indexing completed on 2025-01-18 09:54:06
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_REPORTER_REGISTRY_HPP_INCLUDED
0009 #define CATCH_REPORTER_REGISTRY_HPP_INCLUDED
0010
0011 #include <catch2/internal/catch_case_insensitive_comparisons.hpp>
0012 #include <catch2/internal/catch_unique_ptr.hpp>
0013
0014 #include <map>
0015 #include <string>
0016 #include <vector>
0017
0018 namespace Catch {
0019
0020 class IEventListener;
0021 using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
0022 class IReporterFactory;
0023 using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
0024 struct ReporterConfig;
0025 class EventListenerFactory;
0026
0027 class ReporterRegistry {
0028 struct ReporterRegistryImpl;
0029 Detail::unique_ptr<ReporterRegistryImpl> m_impl;
0030
0031 public:
0032 ReporterRegistry();
0033 ~ReporterRegistry();
0034
0035 IEventListenerPtr create( std::string const& name,
0036 ReporterConfig&& config ) const;
0037
0038 void registerReporter( std::string const& name,
0039 IReporterFactoryPtr factory );
0040
0041 void
0042 registerListener( Detail::unique_ptr<EventListenerFactory> factory );
0043
0044 std::map<std::string,
0045 IReporterFactoryPtr,
0046 Detail::CaseInsensitiveLess> const&
0047 getFactories() const;
0048
0049 std::vector<Detail::unique_ptr<EventListenerFactory>> const&
0050 getListeners() const;
0051 };
0052
0053 }
0054
0055 #endif