-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathrp_factpory_impl.cpp
More file actions
94 lines (71 loc) · 2.73 KB
/
rp_factpory_impl.cpp
File metadata and controls
94 lines (71 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include "reporter/impl/rp_factpory_impl.hpp"
#include "reporter/api/enums/rp_reporter_kind.hpp"
#include "reporter/impl/different_type_reporter/rp_different_type_reporter.hpp"
#include "reporter/impl/dump_reporter/rp_dump_reporter.hpp"
#include "reporter/impl/most_impact_reporter/rp_most_impact_reporter.hpp"
#include "reporter/impl/unincluded_reporter/rp_unincluded_reporter.hpp"
#include "reporter/impl/unresolved_reporter/rp_unresolved_reporter.hpp"
#include "reporter/impl/rp_settings_impl.hpp"
#include "exception/ih/exc_internal_error.hpp"
#include <memory>
//------------------------------------------------------------------------------
namespace reporter
{
//------------------------------------------------------------------------------
FactoryImpl::ReporterPtr FactoryImpl::createReporter( ReporterKind _kind )
{
constexpr int ReporterKindCount = 5;
static_assert(
static_cast< int >( ReporterKind::Count ) == ReporterKindCount );
switch( _kind )
{
case ReporterKind::Unresolved:
return createUnresolvedReporter();
case ReporterKind::MostImpact:
return createMostImpactReporter();
case ReporterKind::Unincluded:
return createUnincludedReporter();
case ReporterKind::Dump:
return createDumpReporter();
case ReporterKind::DifferentType:
return createDifferentTypeReporter();
case ReporterKind::Count:
{
INTERNAL_CHECK_WARRING( false );
return nullptr;
}
}
return nullptr;
}
//------------------------------------------------------------------------------
FactoryImpl::ReporterPtr FactoryImpl::createDumpReporter()
{
return ReporterPtr{ new DumpReporter{ createSettings() } };
}
//------------------------------------------------------------------------------
FactoryImpl::ReporterPtr FactoryImpl::createUnresolvedReporter()
{
return ReporterPtr{ new UnresolvedReporter{ createSettings() } };
}
//------------------------------------------------------------------------------
FactoryImpl::ReporterPtr FactoryImpl::createMostImpactReporter()
{
return ReporterPtr{ new MostImpcatReporter{ createSettings() } };
}
//------------------------------------------------------------------------------
FactoryImpl::ReporterPtr FactoryImpl::createUnincludedReporter()
{
return ReporterPtr{ new UnincludedReporter{ createSettings() } };
}
//------------------------------------------------------------------------------
FactoryImpl::ReporterPtr FactoryImpl::createDifferentTypeReporter()
{
return ReporterPtr{ new DifferentTypeReporter{ createSettings() } };
}
//------------------------------------------------------------------------------
FactoryImpl::SettingsPtr FactoryImpl::createSettings()
{
return SettingsPtr{ new SettingsImpl };
}
//------------------------------------------------------------------------------
}