std::vector<Date> ECB::nextDates(const Date& date) { Date d = (date == Date() ? Settings::instance().evaluationDate() : date); std::set<Date>::const_iterator i = std::upper_bound(knownDates().begin(), knownDates().end(), d); QL_REQUIRE(i!=knownDates().end(), "ECB dates after " << *knownDates().end() << " are unknown"); return std::vector<Date>(i, knownDates().end()); }
std::vector<Date> ECB::nextDates(const Date& date) { Date d = (date == Date() ? Settings::instance().evaluationDate() : date); std::set<Date>::const_iterator i = std::upper_bound(knownDates().begin(), knownDates().end(), d); QL_REQUIRE(i!=knownDates().end(), "ECB dates after " << *knownDates().end() << " are unknown"); std::vector<Date> res; res.reserve(knownDates().size()); const std::set<Date>::const_iterator last = knownDates().end(); while (i != last) { res.push_back(*i); ++i; } return res; }
void ECB::removeDate(const Date& d) { knownDates(); // just to ensure inizialization knownDateSet.erase(d); }
void ECB::addDate(const Date& d) { knownDates(); // just to ensure inizialization knownDateSet.insert(d); }