Coverage Report

Created: 2026-03-31 07:01

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/time/calendars/germany.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2004 Ferdinando Ametrano
5
6
 This file is part of QuantLib, a free-software/open-source library
7
 for financial quantitative analysts and developers - http://quantlib.org/
8
9
 QuantLib is free software: you can redistribute it and/or modify it
10
 under the terms of the QuantLib license.  You should have received a
11
 copy of the license along with this program; if not, please email
12
 <quantlib-dev@lists.sf.net>. The license is also available online at
13
 <https://www.quantlib.org/license.shtml>.
14
15
 This program is distributed in the hope that it will be useful, but WITHOUT
16
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
 FOR A PARTICULAR PURPOSE.  See the license for more details.
18
*/
19
20
/*! \file germany.hpp
21
    \brief German calendars
22
*/
23
24
#ifndef quantlib_germany_calendar_hpp
25
#define quantlib_germany_calendar_hpp
26
27
#include <ql/time/calendar.hpp>
28
29
namespace QuantLib {
30
31
    //! German calendars
32
    /*! Public holidays:
33
        <ul>
34
        <li>Saturdays</li>
35
        <li>Sundays</li>
36
        <li>New Year's Day, January 1st</li>
37
        <li>Good Friday</li>
38
        <li>Easter Monday</li>
39
        <li>Ascension Thursday</li>
40
        <li>Whit Monday</li>
41
        <li>Corpus Christi</li>
42
        <li>Labour Day, May 1st</li>
43
        <li>National Day, October 3rd</li>
44
        <li>Christmas Eve, December 24th</li>
45
        <li>Christmas, December 25th</li>
46
        <li>Boxing Day, December 26th</li>
47
        </ul>
48
49
        Holidays for the Frankfurt Stock exchange
50
        (data from http://deutsche-boerse.com/):
51
        <ul>
52
        <li>Saturdays</li>
53
        <li>Sundays</li>
54
        <li>New Year's Day, January 1st</li>
55
        <li>Good Friday</li>
56
        <li>Easter Monday</li>
57
        <li>Labour Day, May 1st</li>
58
        <li>Christmas' Eve, December 24th</li>
59
        <li>Christmas, December 25th</li>
60
        <li>Christmas Holiday, December 26th</li>
61
        </ul>
62
63
        Holidays for the Xetra exchange
64
        (data from http://deutsche-boerse.com/):
65
        <ul>
66
        <li>Saturdays</li>
67
        <li>Sundays</li>
68
        <li>New Year's Day, January 1st</li>
69
        <li>Good Friday</li>
70
        <li>Easter Monday</li>
71
        <li>Labour Day, May 1st</li>
72
        <li>Christmas' Eve, December 24th</li>
73
        <li>Christmas, December 25th</li>
74
        <li>Christmas Holiday, December 26th</li>
75
        </ul>
76
77
        Holidays for the Eurex exchange
78
        (data from http://www.eurexchange.com/index.html):
79
        <ul>
80
        <li>Saturdays</li>
81
        <li>Sundays</li>
82
        <li>New Year's Day, January 1st</li>
83
        <li>Good Friday</li>
84
        <li>Easter Monday</li>
85
        <li>Labour Day, May 1st</li>
86
        <li>Christmas' Eve, December 24th</li>
87
        <li>Christmas, December 25th</li>
88
        <li>Christmas Holiday, December 26th</li>
89
        <li>New Year's Eve, December 31st</li>
90
        </ul>
91
92
        Holidays for the Euwax exchange
93
        (data from http://www.boerse-stuttgart.de):
94
        <ul>
95
        <li>Saturdays</li>
96
        <li>Sundays</li>
97
        <li>New Year's Day, January 1st</li>
98
        <li>Good Friday</li>
99
        <li>Easter Monday</li>
100
        <li>Labour Day, May 1st</li>
101
        <li>Whit Monday</li>
102
        <li>Christmas' Eve, December 24th</li>
103
        <li>Christmas, December 25th</li>
104
        <li>Christmas Holiday, December 26th</li>
105
        </ul>
106
107
        \ingroup calendars
108
109
        \test the correctness of the returned results is tested
110
              against a list of known holidays.
111
    */
112
    class Germany : public Calendar {
113
      private:
114
        class SettlementImpl final : public Calendar::WesternImpl {
115
          public:
116
0
            std::string name() const override { return "German settlement"; }
117
            bool isBusinessDay(const Date&) const override;
118
        };
119
        class FrankfurtStockExchangeImpl final : public Calendar::WesternImpl {
120
          public:
121
0
            std::string name() const override { return "Frankfurt stock exchange"; }
122
            bool isBusinessDay(const Date&) const override;
123
        };
124
        class XetraImpl final : public Calendar::WesternImpl {
125
          public:
126
0
            std::string name() const override { return "Xetra"; }
127
            bool isBusinessDay(const Date&) const override;
128
        };
129
        class EurexImpl final : public Calendar::WesternImpl {
130
          public:
131
0
            std::string name() const override { return "Eurex"; }
132
            bool isBusinessDay(const Date&) const override;
133
        };
134
        class EuwaxImpl final : public Calendar::WesternImpl {
135
        public:
136
0
          std::string name() const override { return "Euwax"; }
137
          bool isBusinessDay(const Date&) const override;
138
        };
139
140
      public:
141
        //! German calendars
142
        enum Market { Settlement,             //!< generic settlement calendar
143
                      FrankfurtStockExchange, //!< Frankfurt stock-exchange
144
                      Xetra,                  //!< Xetra
145
                      Eurex,                  //!< Eurex
146
                      Euwax                   //!< Euwax
147
        };
148
        Germany(Market market = FrankfurtStockExchange);
149
    };
150
151
}
152
153
154
#endif