Storm 1.13.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
7
8namespace storm {
9
10template<typename EnvironmentType>
12 // Intentionally left empty
14
15template<typename EnvironmentType>
16SubEnvironment<EnvironmentType>::SubEnvironment(SubEnvironment const& other) : subEnv(other.subEnv ? new EnvironmentType(*other.subEnv) : nullptr) {
17 // Intentionally left empty
18}
19
20template<typename EnvironmentType>
22 if (other.subEnv) {
23 subEnv = std::make_unique<EnvironmentType>(*other.subEnv);
24 } else {
25 subEnv.reset();
26 }
27 return *this;
28}
29
30template<typename EnvironmentType>
31EnvironmentType const& SubEnvironment<EnvironmentType>::get() const {
32 assertInitialized();
33 return *subEnv;
34}
35
36template<typename EnvironmentType>
38 assertInitialized();
39 return *subEnv;
40}
41
42template<typename EnvironmentType>
43void SubEnvironment<EnvironmentType>::assertInitialized() const {
44 if (!subEnv) {
45 subEnv = std::make_unique<EnvironmentType>();
46 }
47}
48
50
54
67
68} // namespace storm
SubEnvironment< EnvironmentType > & operator=(SubEnvironment const &other)
EnvironmentType const & get() const