Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SubEnvironment.cpp
Go to the documentation of this file.
1#include <memory>
2
4
8
9namespace storm {
11template<typename EnvironmentType>
13 // Intentionally left empty
14}
15
16template<typename EnvironmentType>
17SubEnvironment<EnvironmentType>::SubEnvironment(SubEnvironment const& other) : subEnv(other.subEnv ? new EnvironmentType(*other.subEnv) : nullptr) {
18 // Intentionally left empty
19}
20
21template<typename EnvironmentType>
23 if (other.subEnv) {
24 subEnv = std::make_unique<EnvironmentType>(*other.subEnv);
25 } else {
26 subEnv.reset();
27 }
28 return *this;
29}
30
31template<typename EnvironmentType>
32EnvironmentType const& SubEnvironment<EnvironmentType>::get() const {
33 assertInitialized();
34 return *subEnv;
35}
36
37template<typename EnvironmentType>
39 assertInitialized();
40 return *subEnv;
41}
42
43template<typename EnvironmentType>
44void SubEnvironment<EnvironmentType>::assertInitialized() const {
45 if (!subEnv) {
46 subEnv = std::make_unique<EnvironmentType>();
47 }
48}
49
51
55
59
75
76} // namespace storm
SubEnvironment< EnvironmentType > & operator=(SubEnvironment const &other)
EnvironmentType const & get() const