Fixed temporary encapsulation violation

This commit is contained in:
Phil Nash 2010-11-10 08:43:48 +00:00
parent 16a6dd5746
commit e3bcf68f7a
2 changed files with 9 additions and 3 deletions

View File

@ -22,8 +22,8 @@ namespace Catch
if( config.listWhat() & RunnerConfig::listReports ) if( config.listWhat() & RunnerConfig::listReports )
{ {
std::cout << "Available reports:\n"; std::cout << "Available reports:\n";
ReporterRegistry::FactoryMap::const_iterator it = ReporterRegistry::instance().m_factories.begin(); ReporterRegistry::FactoryMap::const_iterator it = ReporterRegistry::instance().getFactories().begin();
ReporterRegistry::FactoryMap::const_iterator itEnd = ReporterRegistry::instance().m_factories.end(); ReporterRegistry::FactoryMap::const_iterator itEnd = ReporterRegistry::instance().getFactories().end();
for(; it != itEnd; ++it ) for(; it != itEnd; ++it )
{ {
// !TBD: consider listAs() // !TBD: consider listAs()

View File

@ -146,8 +146,14 @@ namespace Catch
m_factories.insert( std::make_pair( name, new ReporterFactory<T>() ) ); m_factories.insert( std::make_pair( name, new ReporterFactory<T>() ) );
} }
// private: // !TBD
typedef std::map<std::string, IReporterFactory*> FactoryMap; typedef std::map<std::string, IReporterFactory*> FactoryMap;
const FactoryMap& getFactories() const
{
return m_factories;
}
private:
FactoryMap m_factories; FactoryMap m_factories;
}; };