Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
fixings.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 ored/marketdata/loader.hpp
20 \brief Market Datum Loader Interface
21 \ingroup marketdata
22*/
23
24#pragma once
25
26#include <ql/time/date.hpp>
27
31
32#include <boost/serialization/serialization.hpp>
33#include <ql/shared_ptr.hpp>
34
35#include <vector>
36
37namespace ore {
38namespace data {
39
40//! Fixing data structure
41/*!
42 \ingroup marketdata
43*/
44struct Fixing {
45 //! Fixing date
46 QuantLib::Date date = QuantLib::Date();
47 //! Index name
48 std::string name = string();
49 //! Fixing amount
50 QuantLib::Real fixing = QuantLib::Null<QuantLib::Real>();
51
52 //! Constructor
53 Fixing() {}
54 Fixing(const QuantLib::Date& d, const std::string& s, const QuantLib::Real f) : date(d), name(s), fixing(f) {}
55 bool empty() { return name.empty() && date == QuantLib::Date() && fixing == QuantLib::Null<QuantLib::Real>(); }
56
57private:
58 //! Serialization
60 template <class Archive> void serialize(Archive& ar, const unsigned int version) {
61 ar& date;
62 ar& name;
63 ar& fixing;
64 }
65};
66
67//! Compare fixings
68bool operator<(const Fixing& f1, const Fixing& f2);
69
70//! Utility to write a vector of fixings in the QuantLib index manager's fixing history
71void applyFixings(const std::set<Fixing>& fixings);
72
73} // namespace data
74} // namespace ore
Currency and instrument specific conventions/defaults.
@ data
Definition: log.hpp:77
Market data representation.
bool operator<(const Dividend &d1, const Dividend &d2)
void applyFixings(const set< Fixing > &fixings)
Utility to write a vector of fixings in the QuantLib index manager's fixing history.
Definition: fixings.cpp:41
Serializable Credit Default Swap.
Definition: namespaces.docs:23
support for QuantLib::Date serialization
Fixing data structure.
Definition: fixings.hpp:44
QuantLib::Real fixing
Fixing amount.
Definition: fixings.hpp:50
void serialize(Archive &ar, const unsigned int version)
Definition: fixings.hpp:60
Fixing(const QuantLib::Date &d, const std::string &s, const QuantLib::Real f)
Definition: fixings.hpp:54
std::string name
Index name.
Definition: fixings.hpp:48
Fixing()
Constructor.
Definition: fixings.hpp:53
friend class boost::serialization::access
Serialization.
Definition: fixings.hpp:59
QuantLib::Date date
Fixing date.
Definition: fixings.hpp:46