OGS
TimeInterval.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "TimeInterval.h"
5
7#include "Time.h"
8
9namespace NumLib
10{
11bool TimeInterval::contains(double const current_time) const
12{
13 Time const time{current_time};
14 return Time{start_time} <= time && time <= Time{end_time};
15}
16
18{
20 auto const& time_interval_config = config.getConfigSubtree("time_interval");
21
22 const auto start_time =
24 time_interval_config.getConfigParameter<double>("start");
25
26 const auto end_time =
28 time_interval_config.getConfigParameter<double>("end");
29
30 return {start_time, end_time};
31}
32} // namespace NumLib
T getConfigParameter(std::string const &param) const
ConfigTree getConfigSubtree(std::string const &root) const
TimeInterval createTimeInterval(BaseLib::ConfigTree const &config)
bool contains(double const current_time) const