32 : rule_(
r), calendars_(2) {
42 : rule_(
r), calendars_(3) {
53 : rule_(
r), calendars_(4) {
61 : rule_(
r), calendars_(
std::move(cv)) {}
64 std::ostringstream out;
67 out <<
"JoinHolidays(";
70 out <<
"JoinBusinessDays(";
73 QL_FAIL(
"unknown joint calendar rule");
75 out << calendars_.front().name();
76 std::vector<Calendar>::const_iterator i;
77 for (i=calendars_.begin()+1; i!=calendars_.end(); ++i)
78 out <<
", " << i->name();
84 std::vector<Calendar>::const_iterator i;
87 for (i=calendars_.begin(); i!=calendars_.end(); ++i) {
93 for (i=calendars_.begin(); i!=calendars_.end(); ++i) {
99 QL_FAIL(
"unknown joint calendar rule");
104 std::vector<Calendar>::const_iterator i;
107 for (i=calendars_.begin(); i!=calendars_.end(); ++i) {
108 if (i->isHoliday(date))
113 for (i=calendars_.begin(); i!=calendars_.end(); ++i) {
114 if (i->isBusinessDay(date))
119 QL_FAIL(
"unknown joint calendar rule");
127 impl_ = ext::shared_ptr<Calendar::Impl>(
135 impl_ = ext::shared_ptr<Calendar::Impl>(
144 impl_ = ext::shared_ptr<Calendar::Impl>(
150 impl_ = ext::shared_ptr<Calendar::Impl>(
ext::shared_ptr< Impl > impl_
bool isBusinessDay(const Date &) const override
Impl(const Calendar &, const Calendar &, JointCalendarRule)
std::vector< Calendar > calendars_
std::string name() const override
bool isWeekend(Weekday) const override
JointCalendar(const Calendar &, const Calendar &, JointCalendarRule=JoinHolidays)
Classes and functions for error handling.
#define QL_FAIL(message)
throw an error (possibly with file and line information)
JointCalendarRule
rules for joining calendars
ext::shared_ptr< YieldTermStructure > r