Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Payment Class Reference

Payment Instrument. More...

#include <qle/instruments/payment.hpp>

+ Inheritance diagram for Payment:
+ Collaboration diagram for Payment:

Classes

class  arguments
 
class  engine
 
class  results
 

Public Member Functions

 Payment (const Real amount, const Currency &currency, const Date &date)
 
Additional interface
Currency currency () const
 
const QuantLib::ext::shared_ptr< SimpleCashFlow > & cashFlow () const
 

Instrument interface

Currency currency_
 
QuantLib::ext::shared_ptr< SimpleCashFlow > cashflow_
 
bool isExpired () const override
 
void setupArguments (PricingEngine::arguments *) const override
 
void fetchResults (const PricingEngine::results *) const override
 
void setupExpired () const override
 

Detailed Description

Payment Instrument.

This class holds the data for single payment.

\ingroup instruments

Definition at line 43 of file payment.hpp.

Constructor & Destructor Documentation

◆ Payment()

Payment ( const Real  amount,
const Currency &  currency,
const Date &  date 
)

Definition at line 30 of file payment.cpp.

32 cashflow_ = QuantLib::ext::make_shared<SimpleCashFlow>(amount, date);
33}
Currency currency_
Definition: payment.hpp:68
Currency currency() const
Definition: payment.hpp:59
QuantLib::ext::shared_ptr< SimpleCashFlow > cashflow_
Definition: payment.hpp:69

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 35 of file payment.cpp.

35{ return cashflow_->hasOccurred(); }

◆ setupArguments()

void setupArguments ( PricingEngine::arguments *  args) const
override

Definition at line 39 of file payment.cpp.

39 {
40 Payment::arguments* arguments = dynamic_cast<Payment::arguments*>(args);
41 QL_REQUIRE(arguments, "wrong argument type in deposit");
42 arguments->currency = currency_;
43 arguments->cashflow = cashflow_;
44}

◆ fetchResults()

void fetchResults ( const PricingEngine::results *  r) const
override

Definition at line 46 of file payment.cpp.

46 {
47 Instrument::fetchResults(r);
48 const Payment::results* results = dynamic_cast<const Payment::results*>(r);
49 QL_REQUIRE(results, "wrong result type");
50}

◆ currency()

Currency currency ( ) const

Definition at line 59 of file payment.hpp.

59{ return currency_; }

◆ cashFlow()

const QuantLib::ext::shared_ptr< SimpleCashFlow > & cashFlow ( ) const

Definition at line 60 of file payment.hpp.

60{ return cashflow_; }
+ Here is the caller graph for this function:

◆ setupExpired()

void setupExpired ( ) const
overrideprivate

Definition at line 37 of file payment.cpp.

37{ Instrument::setupExpired(); }

Member Data Documentation

◆ currency_

Currency currency_
private

Definition at line 68 of file payment.hpp.

◆ cashflow_

QuantLib::ext::shared_ptr<SimpleCashFlow> cashflow_
private

Definition at line 69 of file payment.hpp.