20#include <ql/cashflows/cpicouponpricer.hpp>
21#include <ql/cashflows/inflationcoupon.hpp>
22#include <ql/cashflows/inflationcouponpricer.hpp>
29 const ext::shared_ptr<CappedFlooredCPICashFlow>& underlying)
30 : CPICashFlow(underlying->notional(), underlying->cpiIndex(), underlying->baseDate(), underlying->baseFixing(),
31 underlying->observationDate(), underlying->observationLag(),
32 underlying->interpolation(), underlying->date(), underlying->growthOnly()),
33 underlying_(underlying) {
42 const ext::shared_ptr<CappedFlooredCPICoupon>& underlying)
43 :
CPICoupon(underlying->baseCPI(), underlying->date(), underlying->nominal(), underlying->accrualStartDate(),
44 underlying->accrualEndDate(), underlying->cpiIndex(),
45 underlying->observationLag(), underlying->observationInterpolation(), underlying->dayCounter(),
46 underlying->fixedRate(), underlying->referencePeriodStart(),
47 underlying->referencePeriodEnd(), underlying->exCouponDate()),
48 underlying_(underlying) {
55 QL_FAIL(
"not implemented");
60 QL_FAIL(
"not implemented");
65 QL_FAIL(
"not implemented");
70 QL_FAIL(
"not implemented");
78 Visitor<StrippedCappedFlooredCPICoupon>* v1 =
dynamic_cast<Visitor<StrippedCappedFlooredCPICoupon>*
>(&v);
92 : underlyingLeg_(underlyingLeg) {}
94StrippedCappedFlooredCPICouponLeg::operator Leg()
const {
96 resultLeg.reserve(underlyingLeg_.size());
97 ext::shared_ptr<CappedFlooredCPICoupon> c;
98 ext::shared_ptr<CappedFlooredCPICashFlow> f;
99 for (Leg::const_iterator i = underlyingLeg_.begin(); i != underlyingLeg_.end(); ++i) {
100 if ((c = ext::dynamic_pointer_cast<CappedFlooredCPICoupon>(*i)) != NULL) {
101 resultLeg.push_back(ext::make_shared<StrippedCappedFlooredCPICoupon>(c));
102 }
else if ((f = ext::dynamic_pointer_cast<CappedFlooredCPICashFlow>(*i)) != NULL) {
103 resultLeg.push_back(ext::make_shared<StrippedCappedFlooredCPICashFlow>(f));
Real amount() const override
Cashflow interface.
StrippedCappedFlooredCPICashFlow(const ext::shared_ptr< CappedFlooredCPICashFlow > &underlying)
ext::shared_ptr< CappedFlooredCPICashFlow > underlying_
void update() override
Observer interface.
StrippedCappedFlooredCPICoupon(const ext::shared_ptr< CappedFlooredCPICoupon > &underlying)
Rate rate() const override
Coupon interface.
virtual void accept(AcyclicVisitor &) override
Visitability.
Rate effectiveCap() const
ext::shared_ptr< CappedFlooredCPICoupon > underlying_
Rate effectiveFloor() const
StrippedCappedFlooredCPICouponLeg(const Leg &underlyingLeg)
strips the embedded option from cap floored cpi coupons