Handles non-contiguous time period.
More...
#include <ored/utilities/timeperiod.hpp>
Handles non-contiguous time period.
Definition at line 41 of file timeperiod.hpp.
◆ TimePeriod()
TimePeriod |
( |
const std::vector< Date > & |
dates, |
|
|
Size |
mporDays = QuantLib::Null<Size>() , |
|
|
const QuantLib::Calendar & |
calendar = QuantLib::Calendar() |
|
) |
| |
Definition at line 28 of file timeperiod.cpp.
28 {
29 QL_REQUIRE(dates.size() % 2 == 0, "TimePeriod: dates size must be an even number, got " << dates.size());
30 for (Size i = 0; i < dates.size(); ++i) {
31 if (i % 2 == 0) {
32 Date sDate = dates[i];
33 if (!
calendar.empty() && mporDays != QuantLib::Null<Size>())
34 sDate =
calendar.advance(sDate, -mporDays * QuantLib::Days);
36 }
37 else
39 }
40}
std::vector< Date > startDates_
std::vector< Date > endDates_
◆ numberOfContiguousParts()
Size numberOfContiguousParts |
( |
| ) |
const |
◆ startDates()
const std::vector< Date > & startDates |
( |
| ) |
const |
◆ endDates()
const std::vector< Date > & endDates |
( |
| ) |
const |
◆ contains()
bool contains |
( |
const Date & |
d | ) |
const |
Definition at line 42 of file timeperiod.cpp.
42 {
45 return true;
46 }
47 return false;
48}
◆ startDates_
std::vector<Date> startDates_ |
|
private |
◆ endDates_
std::vector<Date> endDates_ |
|
private |