Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
catch_context.cpp
Go to the documentation of this file.
1/*
2 * Created by Phil on 31/12/2010.
3 * Copyright 2010 Two Blue Cubes Ltd. All rights reserved.
4 *
5 * Distributed under the Boost Software License, Version 1.0. (See accompanying
6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 */
8#include "catch_context.h"
9#include "catch_common.h"
10
11namespace Catch {
12
14
15 public: // IContext
17 return m_resultCapture;
18 }
19 IRunner* getRunner() override {
20 return m_runner;
21 }
22
23 IConfigPtr const& getConfig() const override {
24 return m_config;
25 }
26
27 ~Context() override;
28
29 public: // IMutableContext
30 void setResultCapture( IResultCapture* resultCapture ) override {
31 m_resultCapture = resultCapture;
32 }
33 void setRunner( IRunner* runner ) override {
34 m_runner = runner;
35 }
36 void setConfig( IConfigPtr const& config ) override {
37 m_config = config;
38 }
39
41
42 private:
43 IConfigPtr m_config;
44 IRunner* m_runner = nullptr;
45 IResultCapture* m_resultCapture = nullptr;
46 };
47
48 IMutableContext *IMutableContext::currentContext = nullptr;
49
50 void IMutableContext::createContext()
51 {
52 currentContext = new Context();
53 }
54
56 delete IMutableContext::currentContext;
57 IMutableContext::currentContext = nullptr;
58 }
59 IContext::~IContext() = default;
61 Context::~Context() = default;
62}
~Context() override
void setResultCapture(IResultCapture *resultCapture) override
IResultCapture * getResultCapture() override
IRunner * getRunner() override
void setConfig(IConfigPtr const &config) override
void setRunner(IRunner *runner) override
friend IMutableContext & getCurrentMutableContext()
IConfigPtr const & getConfig() const override
std::shared_ptr< IConfig const > IConfigPtr
void cleanUpContext()
virtual ~IContext()