1+ /*
2+ Copyright (C) 2018, 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+ #ifndef ored_CalendarAdjustmentConfig_i
20+ #define ored_CalendarAdjustmentConfig_i
21+
22+ %{
23+ // put c++ declarations here
24+ using ore::data::CalendarAdjustmentConfig;
25+ using std::map;
26+ using std::set;
27+ using std::string;
28+ using std::vector;
29+ using QuantLib::DateGeneration;
30+ using QuantLib::Calendar;
31+ %}
32+
33+ %shared_ptr(CalendarAdjustmentConfig)
34+ class CalendarAdjustmentConfig {
35+ public:
36+ // default constructor
37+ CalendarAdjustmentConfig ();
38+
39+ // This method adds d to the list of holidays for cal name.
40+ void addHolidays (const string& calname, const Date& d);
41+
42+ // This method adds d to the list of business days for cal name.
43+ void addBusinessDays (const string& calname, const Date& d);
44+
45+ // This method adds s as a base calendar for cal name.
46+ void addBaseCalendar (const string& calname, const string& d);
47+
48+ // Returns all the holidays for a given cal name
49+ const set<Date>& getHolidays (const string& calname) const ;
50+
51+ // Returns all the business days for a given calname
52+ const set<Date>& getBusinessDays (const string& calname) const ;
53+
54+ set<string> getCalendars () const ;
55+
56+ const string& getBaseCalendar (const string& calname) const ;
57+
58+ // add all holidays and business days from c to this instance
59+ void append (const CalendarAdjustmentConfig& c);
60+ private:
61+ map<string, string> baseCalendars_;
62+ map<string, set<Date>> additionalHolidays_;
63+ map<string, set<Date>> additionalBusinessDays_;
64+
65+ string normalisedName (const string&) const ;
66+ };
67+
68+
69+ #endif
0 commit comments