|
@ -16,31 +16,44 @@ |
|
|
namespace storm { |
|
|
namespace storm { |
|
|
|
|
|
|
|
|
template<typename EnvironmentType> |
|
|
template<typename EnvironmentType> |
|
|
SubEnvironment<EnvironmentType>::SubEnvironment() : subEnv(std::make_unique<EnvironmentType>()) { |
|
|
|
|
|
|
|
|
SubEnvironment<EnvironmentType>::SubEnvironment() : subEnv(nullptr) { |
|
|
// Intentionally left empty
|
|
|
// Intentionally left empty
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename EnvironmentType> |
|
|
template<typename EnvironmentType> |
|
|
SubEnvironment<EnvironmentType>::SubEnvironment(SubEnvironment const& other) : subEnv(new EnvironmentType(*other.subEnv)) { |
|
|
|
|
|
|
|
|
SubEnvironment<EnvironmentType>::SubEnvironment(SubEnvironment const& other) : subEnv(other.subEnv ? new EnvironmentType(*other.subEnv) : nullptr) { |
|
|
// Intentionally left empty
|
|
|
// Intentionally left empty
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename EnvironmentType> |
|
|
template<typename EnvironmentType> |
|
|
SubEnvironment<EnvironmentType>& SubEnvironment<EnvironmentType>::operator=(SubEnvironment const& other) { |
|
|
SubEnvironment<EnvironmentType>& SubEnvironment<EnvironmentType>::operator=(SubEnvironment const& other) { |
|
|
|
|
|
if (other.subEnv) { |
|
|
subEnv = std::make_unique<EnvironmentType>(*other.subEnv); |
|
|
subEnv = std::make_unique<EnvironmentType>(*other.subEnv); |
|
|
|
|
|
} else { |
|
|
|
|
|
subEnv.reset(); |
|
|
|
|
|
} |
|
|
return *this; |
|
|
return *this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename EnvironmentType> |
|
|
template<typename EnvironmentType> |
|
|
EnvironmentType const& SubEnvironment<EnvironmentType>::get() const { |
|
|
EnvironmentType const& SubEnvironment<EnvironmentType>::get() const { |
|
|
|
|
|
assertInitialized(); |
|
|
return *subEnv; |
|
|
return *subEnv; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<typename EnvironmentType> |
|
|
template<typename EnvironmentType> |
|
|
EnvironmentType& SubEnvironment<EnvironmentType>::get() { |
|
|
EnvironmentType& SubEnvironment<EnvironmentType>::get() { |
|
|
|
|
|
assertInitialized(); |
|
|
return *subEnv; |
|
|
return *subEnv; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<typename EnvironmentType> |
|
|
|
|
|
void SubEnvironment<EnvironmentType>::assertInitialized() const { |
|
|
|
|
|
if (!subEnv) { |
|
|
|
|
|
subEnv = std::make_unique<EnvironmentType>(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
template class SubEnvironment<InternalEnvironment>; |
|
|
template class SubEnvironment<InternalEnvironment>; |
|
|
|
|
|
|
|
|
template class SubEnvironment<MultiObjectiveModelCheckerEnvironment>; |
|
|
template class SubEnvironment<MultiObjectiveModelCheckerEnvironment>; |
|
|