Coverage Report

Created: 2026-02-03 07:02

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/quantlib/ql/time/calendars/singapore.hpp
Line
Count
Source
1
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
/*
4
 Copyright (C) 2004 FIMAT Group
5
 Copyright (C) 2007, 2008, 2009, 2010 StatPro Italia srl
6
 Copyright (C) 2024 Skandinaviska Enskilda Banken AB (publ)
7
8
 This file is part of QuantLib, a free-software/open-source library
9
 for financial quantitative analysts and developers - http://quantlib.org/
10
11
 QuantLib is free software: you can redistribute it and/or modify it
12
 under the terms of the QuantLib license.  You should have received a
13
 copy of the license along with this program; if not, please email
14
 <quantlib-dev@lists.sf.net>. The license is also available online at
15
 <https://www.quantlib.org/license.shtml>.
16
17
 This program is distributed in the hope that it will be useful, but WITHOUT
18
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19
 FOR A PARTICULAR PURPOSE.  See the license for more details.
20
*/
21
22
/*! \file singapore.hpp
23
    \brief Singapore calendars
24
*/
25
26
#ifndef quantlib_singapore_calendar_hpp
27
#define quantlib_singapore_calendar_hpp
28
29
#include <ql/time/calendar.hpp>
30
31
namespace QuantLib {
32
33
    //! %Singapore calendars
34
    /*! Holidays for the Singapore exchange
35
        (data from
36
         <http://www.sgx.com/wps/portal/sgxweb/home/trading/securities/trading_hours_calendar>):
37
        <ul>
38
        <li>Saturdays</li>
39
        <li>Sundays</li>
40
        <li>New Year's day, January 1st</li>
41
        <li>Good Friday</li>
42
        <li>Labour Day, May 1st</li>
43
        <li>National Day, August 9th</li>
44
        <li>Christmas, December 25th </li>
45
        </ul>
46
47
        Other holidays for which no rule is given
48
        (data available for 2004-2010, 2012-2014, 2019-2024 only:)
49
        <ul>
50
        <li>Chinese New Year</li>
51
        <li>Hari Raya Haji</li>
52
        <li>Vesak Poya Day</li>
53
        <li>Deepavali</li>
54
        <li>Diwali</li>
55
        <li>Hari Raya Puasa</li>
56
        </ul>
57
58
        \ingroup calendars
59
    */
60
    class Singapore : public Calendar {
61
      private:
62
        class SgxImpl final : public Calendar::WesternImpl {
63
          public:
64
0
            std::string name() const override { return "Singapore exchange"; }
65
            bool isBusinessDay(const Date&) const override;
66
        };
67
      public:
68
        enum Market { SGX    //!< Singapore exchange
69
        };
70
        Singapore(Market m = SGX);
71
    };
72
73
}
74
75
76
#endif