Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
amendedcalendar.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file amendedcalendar.hpp
20 \brief Amended calendar
21*/
22
23#ifndef quantext_amended_calendar_h
24#define quantext_amended_calendar_h
25
26#include <ql/time/calendar.hpp>
27#include <ql/time/calendars/jointcalendar.hpp>
28
29namespace QuantExt {
30
31//! Amended calendar
32/*! Any added or removed dates do not affect other implementations of this calendar.
33 \ingroup calendars
34
35*/
36class AmendedCalendar : public QuantLib::Calendar {
37private:
38 class Impl : public Calendar::Impl {
39 public:
40 Impl(const QuantLib::Calendar& calendar, const std::string& name);
41 std::string name() const override;
42 bool isWeekend(QuantLib::Weekday) const override;
43 bool isBusinessDay(const QuantLib::Date&) const override;
44
45 private:
46 std::string name_;
47 QuantLib::Calendar baseCalendar_;
48 };
49
50public:
51 AmendedCalendar(const QuantLib::Calendar&, const std::string& name);
52};
53
54} // namespace QuantExt
55
56#endif
bool isBusinessDay(const QuantLib::Date &) const override
std::string name() const override
bool isWeekend(QuantLib::Weekday) const override