QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
commoditycashflow.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 J. Erik Radmall
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_commodity_cash_flow_hpp
25#define quantlib_commodity_cash_flow_hpp
26
27#include <ql/cashflow.hpp>
28#include <ql/money.hpp>
29#include <map>
30#include <utility>
31
32namespace QuantLib {
33
34 class CommodityCashFlow : public CashFlow {
35 public:
43 bool finalized)
51
52 Date date() const override { return date_; }
54
56 Real amount() const override { return discountedAmount_.value(); }
58 const Currency& currency() const {
60 }
61
62 const Money& discountedAmount() const { return discountedAmount_; }
63 const Money& undiscountedAmount() const { return undiscountedAmount_; }
66 }
69 }
72 bool finalized() const { return finalized_; }
73
75
76 void accept(AcyclicVisitor&) override;
78 private:
84 };
85
86 typedef std::map<Date, ext::shared_ptr<CommodityCashFlow> >
88
89 #ifndef __DOXYGEN__
90 std::ostream& operator<<(std::ostream& out,
91 const CommodityCashFlows& cashFlows);
92 #endif
93
94}
95
96#endif
degenerate base class for the Acyclic Visitor pattern
Definition: visitor.hpp:33
Base class for cash flows.
Definition: cashflow.hpp:40
const Money & discountedAmount() const
const Currency & currency() const
Real amount() const override
returns the amount of the cash flow
void accept(AcyclicVisitor &) override
const Money & undiscountedAmount() const
const Money & undiscountedPaymentAmount() const
CommodityCashFlow(const Date &date, Money discountedAmount, Money undiscountedAmount, Money discountedPaymentAmount, Money undiscountedPaymentAmount, Real discountFactor, Real paymentDiscountFactor, bool finalized)
Date date() const override
const Money & discountedPaymentAmount() const
Currency specification
Definition: currency.hpp:36
Concrete date class.
Definition: date.hpp:125
amount of cash
Definition: money.hpp:38
const Currency & currency() const
Definition: money.hpp:173
Decimal value() const
Definition: money.hpp:177
QL_REAL Real
real number
Definition: types.hpp:50
Definition: any.hpp:35
std::map< Date, ext::shared_ptr< CommodityCashFlow > > CommodityCashFlows
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)
STL namespace.