• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Created by Martin on 31/08/2017.
3  *
4  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
5  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  */
7 #include "catch_reporter_registry.h"
8 
9 namespace Catch {
10 
11     ReporterRegistry::~ReporterRegistry() = default;
12 
create(std::string const & name,IConfigPtr const & config) const13     IStreamingReporterPtr ReporterRegistry::create( std::string const& name, IConfigPtr const& config ) const {
14         auto it =  m_factories.find( name );
15         if( it == m_factories.end() )
16             return nullptr;
17         return it->second->create( ReporterConfig( config ) );
18     }
19 
registerReporter(std::string const & name,IReporterFactoryPtr const & factory)20     void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) {
21         m_factories.emplace(name, factory);
22     }
registerListener(IReporterFactoryPtr const & factory)23     void ReporterRegistry::registerListener( IReporterFactoryPtr const& factory ) {
24         m_listeners.push_back( factory );
25     }
26 
getFactories() const27     IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const {
28         return m_factories;
29     }
getListeners() const30     IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const {
31         return m_listeners;
32     }
33 
34 }
35