15
15
16
16
namespace power_grid_model {
17
17
18
- template <class MainModel , typename ... ComponentType> class JobDispatchAdapter ;
18
+ template <class MainModel , typename ... ComponentType> class JobAdapter ;
19
19
20
20
template <class MainModel , class ... ComponentType>
21
- class JobDispatchAdapter <MainModel, ComponentList<ComponentType...>>
22
- : public JobDispatchInterface<JobDispatchAdapter <MainModel, ComponentList<ComponentType...>>> {
21
+ class JobAdapter <MainModel, ComponentList<ComponentType...>>
22
+ : public JobInterface<JobAdapter <MainModel, ComponentList<ComponentType...>>> {
23
23
public:
24
- JobDispatchAdapter (std::reference_wrapper<MainModel> model_reference,
25
- std::reference_wrapper<MainModelOptions const > options)
24
+ JobAdapter (std::reference_wrapper<MainModel> model_reference,
25
+ std::reference_wrapper<MainModelOptions const > options)
26
26
: model_reference_{model_reference}, options_{options} {}
27
- JobDispatchAdapter (JobDispatchAdapter const & other)
27
+ JobAdapter (JobAdapter const & other)
28
28
: model_copy_{std::make_unique<MainModel>(other.model_reference_ .get ())},
29
29
model_reference_{std::ref (*model_copy_)},
30
30
options_{std::ref (other.options_ )},
31
31
components_to_update_{other.components_to_update_ },
32
32
update_independence_{other.update_independence_ },
33
33
independence_flags_{other.independence_flags_ },
34
34
all_scenarios_sequence_{other.all_scenarios_sequence_ } {}
35
- JobDispatchAdapter & operator =(JobDispatchAdapter const & other) {
35
+ JobAdapter & operator =(JobAdapter const & other) {
36
36
if (this != &other) {
37
37
model_copy_ = std::make_unique<MainModel>(other.model_reference_ .get ());
38
38
model_reference_ = std::ref (*model_copy_);
@@ -44,15 +44,15 @@ class JobDispatchAdapter<MainModel, ComponentList<ComponentType...>>
44
44
}
45
45
return *this ;
46
46
}
47
- JobDispatchAdapter (JobDispatchAdapter && other) noexcept
47
+ JobAdapter (JobAdapter && other) noexcept
48
48
: model_copy_{std::move (other.model_copy_ )},
49
49
model_reference_{model_copy_ ? std::ref (*model_copy_) : std::move (other.model_reference_ )},
50
50
options_{other.options_ },
51
51
components_to_update_{std::move (other.components_to_update_ )},
52
52
update_independence_{std::move (other.update_independence_ )},
53
53
independence_flags_{std::move (other.independence_flags_ )},
54
54
all_scenarios_sequence_{std::move (other.all_scenarios_sequence_ )} {}
55
- JobDispatchAdapter & operator =(JobDispatchAdapter && other) noexcept {
55
+ JobAdapter & operator =(JobAdapter && other) noexcept {
56
56
if (this != &other) {
57
57
model_copy_ = std::move (other.model_copy_ );
58
58
model_reference_ = model_copy_ ? std::ref (*model_copy_) : std::move (other.model_reference_ );
@@ -64,13 +64,13 @@ class JobDispatchAdapter<MainModel, ComponentList<ComponentType...>>
64
64
}
65
65
return *this ;
66
66
}
67
- ~JobDispatchAdapter () { model_copy_.reset (); }
67
+ ~JobAdapter () { model_copy_.reset (); }
68
68
69
69
private:
70
- // Grant the CRTP base (JobDispatchInterface<JobDispatchAdapter >) access to
71
- // JobDispatchAdapter 's private members. This allows the base class template
70
+ // Grant the CRTP base (JobInterface<JobAdapter >) access to
71
+ // JobAdapter 's private members. This allows the base class template
72
72
// to call derived-class implementation details as part of the CRTP pattern.
73
- friend class JobDispatchInterface <JobDispatchAdapter >;
73
+ friend class JobInterface <JobAdapter >;
74
74
75
75
std::unique_ptr<MainModel> model_copy_;
76
76
std::reference_wrapper<MainModel> model_reference_;
0 commit comments