MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / addReporter

Function addReporter

unittests/catch.hpp:7628–7647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7626 IReporterRegistry::~IReporterRegistry() = default;
7627
7628 void addReporter( IStreamingReporterPtr& existingReporter, IStreamingReporterPtr&& additionalReporter ) {
7629
7630 if( !existingReporter ) {
7631 existingReporter = std::move( additionalReporter );
7632 return;
7633 }
7634
7635 MultipleReporters* multi = nullptr;
7636
7637 if( existingReporter->isMulti() ) {
7638 multi = static_cast<MultipleReporters*>( existingReporter.get() );
7639 }
7640 else {
7641 auto newMulti = std::unique_ptr<MultipleReporters>( new MultipleReporters );
7642 newMulti->add( std::move( existingReporter ) );
7643 multi = newMulti.get();
7644 existingReporter = std::move( newMulti );
7645 }
7646 multi->add( std::move( additionalReporter ) );
7647 }
7648
7649} // end namespace Catch
7650// end catch_interfaces_reporter.cpp

Callers 2

makeReporterFunction · 0.85
addListenersFunction · 0.85

Calls 3

isMultiMethod · 0.80
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected