Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
calendarparser.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 Quaternion Risk Management Ltd
3
4 This file is part of ORE, a free-software/open-source library
5 for transparent pricing and risk analysis - http://opensourcerisk.org
6
7 ORE is free software: you can redistribute it and/or modify it
8 under the terms of the Modified BSD License. You should have received a
9 copy of the license along with this program.
10 The license is also available online at <http://opensourcerisk.org>
11
12 This program is distributed on the basis that it will form a useful
13 contribution to risk analytics and model standardisation, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
16*/
17
18/*! \file ored/utilities/calendarparser.hpp
19 \brief calendar parser singleton class
20 \ingroup utilities
21*/
22
23#pragma once
24
25#include <map>
26#include <ql/patterns/singleton.hpp>
27#include <ql/time/calendar.hpp>
28
29#include <boost/thread/shared_mutex.hpp>
30#include <boost/thread/lock_types.hpp>
31
32namespace ore {
33namespace data {
34
35class CalendarParser : public QuantLib::Singleton<CalendarParser, std::integral_constant<bool, true>> {
36public:
38 QuantLib::Calendar parseCalendar(const std::string& name) const;
39 QuantLib::Calendar addCalendar(const std::string baseName, std::string& newName);
40 void reset();
42
43private:
44 mutable boost::shared_mutex mutex_;
45 std::map<std::string, QuantLib::Calendar> calendars_;
46};
47
48} // namespace data
49} // namespace ore
std::map< std::string, QuantLib::Calendar > calendars_
QuantLib::Calendar addCalendar(const std::string baseName, std::string &newName)
QuantLib::Calendar parseCalendar(const std::string &name) const
boost::shared_mutex mutex_
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
string name