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

helper class building a sequence of bond trs cashflows More...

#include <qle/cashflows/bondtrscashflow.hpp>

+ Collaboration diagram for BondTRSLeg:

Public Member Functions

 BondTRSLeg (const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const Real bondNotional, const QuantLib::ext::shared_ptr< BondIndex > &bondIndex, const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr)
 
BondTRSLegwithInitialPrice (Real)
 
 operator Leg () const
 

Private Attributes

std::vector< Date > valuationDates_
 
std::vector< Date > paymentDates_
 
Real bondNotional_
 
QuantLib::ext::shared_ptr< BondIndexbondIndex_
 
QuantLib::ext::shared_ptr< FxIndexfxIndex_
 
Real initialPrice_ = QuantLib::Null<QuantLib::Real>()
 

Detailed Description

helper class building a sequence of bond trs cashflows

Definition at line 54 of file bondtrscashflow.hpp.

Constructor & Destructor Documentation

◆ BondTRSLeg()

BondTRSLeg ( const std::vector< Date > &  valuationDates,
const std::vector< Date > &  paymentDates,
const Real  bondNotional,
const QuantLib::ext::shared_ptr< BondIndex > &  bondIndex,
const QuantLib::ext::shared_ptr< FxIndex > &  fxIndex = nullptr 
)

Definition at line 39 of file bondtrscashflow.cpp.

42 : valuationDates_(valuationDates), paymentDates_(paymentDates), bondNotional_(bondNotional), bondIndex_(bondIndex),
43 fxIndex_(fxIndex) {}
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
std::vector< Date > valuationDates_
std::vector< Date > paymentDates_
QuantLib::ext::shared_ptr< BondIndex > bondIndex_

Member Function Documentation

◆ withInitialPrice()

BondTRSLeg & withInitialPrice ( Real  initialPrice)

Definition at line 45 of file bondtrscashflow.cpp.

45 {
46 initialPrice_ = initialPrice;
47 return *this;
48}
+ Here is the caller graph for this function:

◆ operator Leg()

operator Leg ( ) const

Definition at line 50 of file bondtrscashflow.cpp.

50 {
51 Leg leg;
52 Real initialPrice;
53
54 for (Size i = 0; i < valuationDates_.size() - 1; ++i) {
55 initialPrice = i == 0 ? initialPrice_ : Null<Real>();
56 leg.push_back(QuantLib::ext::make_shared<BondTRSCashFlow>(paymentDates_[i], valuationDates_[i], valuationDates_[i + 1],
57 bondNotional_, bondIndex_, initialPrice, fxIndex_));
58 }
59 return leg;
60}

Member Data Documentation

◆ valuationDates_

std::vector<Date> valuationDates_
private

Definition at line 62 of file bondtrscashflow.hpp.

◆ paymentDates_

std::vector<Date> paymentDates_
private

Definition at line 63 of file bondtrscashflow.hpp.

◆ bondNotional_

Real bondNotional_
private

Definition at line 64 of file bondtrscashflow.hpp.

◆ bondIndex_

QuantLib::ext::shared_ptr<BondIndex> bondIndex_
private

Definition at line 65 of file bondtrscashflow.hpp.

◆ fxIndex_

QuantLib::ext::shared_ptr<FxIndex> fxIndex_
private

Definition at line 66 of file bondtrscashflow.hpp.

◆ initialPrice_

Real initialPrice_ = QuantLib::Null<QuantLib::Real>()
private

Definition at line 67 of file bondtrscashflow.hpp.