|
Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
|
Two dates framing a time interval. More...
#include <date_interval.h>
Public Member Functions | |
| DateInterval (const Date first, const Date last) | |
| Constructor. More... | |
| void | extend (const Date &new_date) |
| Expand the time interval just enough to include a new date. More... | |
| const Date & | get_first () const |
| First day of the interval. More... | |
| const Date & | get_last () const |
| Last day of the interval. More... | |
| bool | matches_output_interval (const OutputInterval &) const |
Private Attributes | |
| Date | first_day |
| Date | last_day |
Two dates framing a time interval.
The first date must not be after the last date, but they can be the same: that is a one-day interval.
Constructor.
| first | First day of the interval. |
| last | Last day of the interval. |
| std::invalid_argument | If first day is after last day. |
| void DateInterval::extend | ( | const Date & | new_date | ) |
Expand the time interval just enough to include a new date.
If the new date is already covered by the interval, nothing is changed.
| new_date | The new day to be included in the interval. |
|
inline |
First day of the interval.
|
inline |
Last day of the interval.
| bool DateInterval::matches_output_interval | ( | const OutputInterval & | output_interval | ) | const |
Check whether last and first day have the distance of given output interval.
|
private |
|
private |