Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
*
* \copyright
* Copyright (c) 2012-2018, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
* File: TimeInterval.h
*
* Created on November 26, 2018, 4:44 PM
*/
#pragma once
namespace NumLib
{
/*!
* Class for a time interval, which has a member to check whether the given time
* is in this time interval.
*/
class TimeInterval
{
public:
TimeInterval(const double start_time, const double end_time)
: _start_time(start_time), _end_time(end_time)
{
}
bool isInThisTimeInterval(const double current_time) const
{
return (current_time >= _start_time && current_time <= _end_time)
? true
: false;
}
private:
const double _start_time;
const double _end_time;
};
} // end of namespace