Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:54:04

0001 
0002 //              Copyright Catch2 Authors
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //   (See accompanying file LICENSE.txt or copy at
0005 //        https://www.boost.org/LICENSE_1_0.txt)
0006 
0007 // SPDX-License-Identifier: BSL-1.0
0008 #ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
0009 #define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
0010 
0011 #include <catch2/internal/catch_unique_ptr.hpp>
0012 #include <catch2/internal/catch_stringref.hpp>
0013 
0014 #include <string>
0015 
0016 namespace Catch {
0017 
0018     struct ReporterConfig;
0019     class IConfig;
0020     class IEventListener;
0021     using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
0022 
0023 
0024     class IReporterFactory {
0025     public:
0026         virtual ~IReporterFactory(); // = default
0027 
0028         virtual IEventListenerPtr
0029         create( ReporterConfig&& config ) const = 0;
0030         virtual std::string getDescription() const = 0;
0031     };
0032     using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
0033 
0034     class EventListenerFactory {
0035     public:
0036         virtual ~EventListenerFactory(); // = default
0037         virtual IEventListenerPtr create( IConfig const* config ) const = 0;
0038         //! Return a meaningful name for the listener, e.g. its type name
0039         virtual StringRef getName() const = 0;
0040         //! Return listener's description if available
0041         virtual std::string getDescription() const = 0;
0042     };
0043 } // namespace Catch
0044 
0045 #endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED