QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
lastfixingquote.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Ferdinando Ametrano
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
24#ifndef quantlib_last_fixing_quote_hpp
25#define quantlib_last_fixing_quote_hpp
26
27#include <ql/quote.hpp>
28#include <ql/index.hpp>
29#include <ql/patterns/observable.hpp>
30
31namespace QuantLib {
32
34 class LastFixingQuote : public Quote,
35 public Observer {
36 public:
37 LastFixingQuote(ext::shared_ptr<Index> index);
39
40 Real value() const override;
41 bool isValid() const override;
43
45 void update() override { notifyObservers(); }
47
49 const ext::shared_ptr<Index>& index() const { return index_; }
50 Date referenceDate() const;
52 protected:
53 ext::shared_ptr<Index> index_;
54 };
55
56}
57
58#endif
Concrete date class.
Definition: date.hpp:125
Quote adapter for the last fixing available of a given Index.
ext::shared_ptr< Index > index_
const ext::shared_ptr< Index > & index() const
Real value() const override
returns the current value
bool isValid() const override
returns true if the Quote holds a valid value
Object that gets notified when a given observable changes.
Definition: observable.hpp:116
purely virtual base class for market observables
Definition: quote.hpp:37
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35