Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
date_interval.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 W. Traylor <wolfgang.traylor@senckenberg.de>
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
11#ifndef FAUNA_DATE_INTERVAL_H
12#define FAUNA_DATE_INTERVAL_H
13
14#include "date.h"
15
16namespace Fauna {
17// Forward Declarations
18enum class OutputInterval : int;
19
21
26 public:
28
33 DateInterval(const Date first, const Date last);
34
36
40 void extend(const Date& new_date);
41
43 const Date& get_first() const { return first_day; }
44
46 const Date& get_last() const { return last_day; }
47
50 bool matches_output_interval(const OutputInterval&) const;
51
52 private:
54};
55} // namespace Fauna
56
57#endif // FAUNA_DATE_INTERVAL_H
Two dates framing a time interval.
Definition: date_interval.h:25
Date last_day
Definition: date_interval.h:53
Date first_day
Definition: date_interval.h:53
const Date & get_last() const
Last day of the interval.
Definition: date_interval.h:46
void extend(const Date &new_date)
Expand the time interval just enough to include a new date.
Definition: date_interval.cpp:25
bool matches_output_interval(const OutputInterval &) const
Definition: date_interval.cpp:32
const Date & get_first() const
First day of the interval.
Definition: date_interval.h:43
Helper class to hold an absolute simulation day.
Definition: date.h:19
Simple class to hold the date of a simulation day.
Definition: average.h:16
OutputInterval
Time interval for aggregating output.
Definition: parameters.h:37