Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
marketdatainmemoryloader.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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 orea/app/marketdatainmemoryloader.hpp
20 \brief Market Data Loader
21*/
22
23#pragma once
24
27
28namespace ore {
29namespace analytics {
30
32public:
34
35 MarketDataInMemoryLoaderImpl(const QuantLib::ext::shared_ptr<InputParameters>& inputs,
36 const std::vector<std::string>& marketData,
37 const std::vector<std::string>& fixingData)
38 : inputs_(inputs), marketData_(marketData), fixingData_(fixingData) {}
39
40 void loadCorporateActionData(QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
41 const std::map<std::string, std::string>& equities) override;
42
43 void retrieveMarketData(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
44 const ore::analytics::QuoteMap& quotes,
45 const QuantLib::Date& marketDate) override;
46
47 void retrieveFixings(const QuantLib::ext::shared_ptr<ore::data::InMemoryLoader>& loader,
48 ore::analytics::FixingMap fixings = {},
49 std::map<std::pair<std::string, QuantLib::Date>, std::set<QuantLib::Date>> lastAvailableFixingLookupMap = {}) override;
50
51private:
52 QuantLib::ext::shared_ptr<InputParameters> inputs_;
53 std::vector<std::string> marketData_;
54 std::vector<std::string> fixingData_;
55};
56
58public:
59 MarketDataInMemoryLoader(const QuantLib::ext::shared_ptr<InputParameters>& inputs,
60 const std::vector<std::string>& marketData,
61 const std::vector<std::string>& fixingData)
62 : MarketDataLoader(inputs, QuantLib::ext::make_shared<MarketDataInMemoryLoaderImpl>(inputs, marketData, fixingData)) {}
63};
64
65} // namespace analytics
66} // namespace ore
MarketDataInMemoryLoader(const QuantLib::ext::shared_ptr< InputParameters > &inputs, const std::vector< std::string > &marketData, const std::vector< std::string > &fixingData)
void retrieveMarketData(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const ore::analytics::QuoteMap &quotes, const QuantLib::Date &marketDate) override
retrieve market data
void retrieveFixings(const QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, ore::analytics::FixingMap fixings={}, std::map< std::pair< std::string, QuantLib::Date >, std::set< QuantLib::Date > > lastAvailableFixingLookupMap={}) override
retrieve fixings
void loadCorporateActionData(QuantLib::ext::shared_ptr< ore::data::InMemoryLoader > &loader, const std::map< std::string, std::string > &equities) override
load corporate action data
MarketDataInMemoryLoaderImpl(const QuantLib::ext::shared_ptr< InputParameters > &inputs, const std::vector< std::string > &marketData, const std::vector< std::string > &fixingData)
QuantLib::ext::shared_ptr< InputParameters > inputs_
Market Data Loader.
std::map< std::string, RequiredFixings::FixingDates > FixingMap
std::map< QuantLib::Date, std::set< std::string > > QuoteMap