mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-17 02:25:38 +02:00
@@ -15,23 +15,23 @@
|
||||
namespace Catch {
|
||||
|
||||
class ReporterRegistry : public IReporterRegistry {
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
virtual ~ReporterRegistry() {
|
||||
deleteAllValues( m_factories );
|
||||
}
|
||||
|
||||
|
||||
virtual IStreamingReporter* create( std::string const& name, Ptr<IConfig> const& config ) const {
|
||||
FactoryMap::const_iterator it = m_factories.find( name );
|
||||
if( it == m_factories.end() )
|
||||
return NULL;
|
||||
return it->second->create( ReporterConfig( config ) );
|
||||
}
|
||||
|
||||
|
||||
void registerReporter( std::string const& name, IReporterFactory* factory ) {
|
||||
m_factories.insert( std::make_pair( name, factory ) );
|
||||
}
|
||||
}
|
||||
|
||||
FactoryMap const& getFactories() const {
|
||||
return m_factories;
|
||||
|
Reference in New Issue
Block a user