File indexing completed on 2025-01-18 09:54:05
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef CATCH_CONTEXT_HPP_INCLUDED
0009 #define CATCH_CONTEXT_HPP_INCLUDED
0010
0011 #include <catch2/internal/catch_compiler_capabilities.hpp>
0012
0013 namespace Catch {
0014
0015 class IResultCapture;
0016 class IConfig;
0017
0018 class Context {
0019 IConfig const* m_config = nullptr;
0020 IResultCapture* m_resultCapture = nullptr;
0021
0022 CATCH_EXPORT static Context* currentContext;
0023 friend Context& getCurrentMutableContext();
0024 friend Context const& getCurrentContext();
0025 static void createContext();
0026 friend void cleanUpContext();
0027
0028 public:
0029 IResultCapture* getResultCapture() const { return m_resultCapture; }
0030 IConfig const* getConfig() const { return m_config; }
0031 void setResultCapture( IResultCapture* resultCapture );
0032 void setConfig( IConfig const* config );
0033 };
0034
0035 Context& getCurrentMutableContext();
0036
0037 inline Context const& getCurrentContext() {
0038
0039
0040 if ( !Context::currentContext ) { Context::createContext(); }
0041
0042 return *Context::currentContext;
0043 }
0044
0045 void cleanUpContext();
0046
0047 class SimplePcg32;
0048 SimplePcg32& sharedRng();
0049 }
0050
0051 #endif