Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
payment.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 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 qle/instruments/payment.hpp
20 \brief payment instrument
21 \ingroup instruments
22*/
23
24#ifndef quantext_payment_hpp
25#define quantext_payment_hpp
26
27#include <ql/cashflows/simplecashflow.hpp>
28#include <ql/currency.hpp>
29#include <ql/instrument.hpp>
30#include <ql/quote.hpp>
31#include <ql/time/calendar.hpp>
32#include <ql/time/daycounter.hpp>
33
34namespace QuantExt {
35using namespace QuantLib;
36
37//! Payment Instrument
38
39/*! This class holds the data for single payment.
40
41 \ingroup instruments
42*/
43class Payment : public Instrument {
44public:
45 class arguments;
46 class results;
47 class engine;
48
49 Payment(const Real amount, const Currency& currency, const Date& date);
50
51 //! \name Instrument interface
52 //@{
53 bool isExpired() const override;
54 void setupArguments(PricingEngine::arguments*) const override;
55 void fetchResults(const PricingEngine::results*) const override;
56 //@}
57 //! \name Additional interface
58 //@{
59 Currency currency() const { return currency_; }
60 const QuantLib::ext::shared_ptr<SimpleCashFlow>& cashFlow() const { return cashflow_; }
61 //@}
62
63private:
64 //! \name Instrument interface
65 //@{
66 void setupExpired() const override;
67 //@}
68 Currency currency_;
69 QuantLib::ext::shared_ptr<SimpleCashFlow> cashflow_;
70};
71
73public:
74 Currency currency;
75 QuantLib::ext::shared_ptr<SimpleCashFlow> cashflow;
76 void validate() const override;
77};
78
79//! \ingroup instruments
81public:
82 void reset() override;
83};
84
85//! \ingroup instruments
86class Payment::engine : public GenericEngine<Payment::arguments, Payment::results> {};
87} // namespace QuantExt
88
89#endif
QuantLib::ext::shared_ptr< SimpleCashFlow > cashflow
Definition: payment.hpp:75
void validate() const override
Definition: payment.cpp:52
void reset() override
Definition: payment.cpp:56
Payment Instrument.
Definition: payment.hpp:43
void setupArguments(PricingEngine::arguments *) const override
Definition: payment.cpp:39
bool isExpired() const override
Definition: payment.cpp:35
const QuantLib::ext::shared_ptr< SimpleCashFlow > & cashFlow() const
Definition: payment.hpp:60
Currency currency_
Definition: payment.hpp:68
void setupExpired() const override
Definition: payment.cpp:37
void fetchResults(const PricingEngine::results *) const override
Definition: payment.cpp:46
Currency currency() const
Definition: payment.hpp:59
QuantLib::ext::shared_ptr< SimpleCashFlow > cashflow_
Definition: payment.hpp:69