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

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

#include <qle/cashflows/trscashflow.hpp>

+ Collaboration diagram for TRSLeg:

Public Member Functions

 TRSLeg (const std::vector< Date > &valuationDates, const std::vector< Date > &paymentDates, const Real notional, const QuantLib::ext::shared_ptr< Index > &index, const QuantLib::ext::shared_ptr< FxIndex > &fxIndex=nullptr)
 
TRSLegwithInitialPrice (Real)
 
 operator Leg () const
 

Private Attributes

std::vector< Date > valuationDates_
 
std::vector< Date > paymentDates_
 
Real notional_
 
QuantLib::ext::shared_ptr< Index > index_
 
QuantLib::ext::shared_ptr< FxIndexfxIndex_
 
Real initialPrice_
 

Detailed Description

helper class building a sequence of trs cashflows

Definition at line 86 of file trscashflow.hpp.

Constructor & Destructor Documentation

◆ TRSLeg()

TRSLeg ( const std::vector< Date > &  valuationDates,
const std::vector< Date > &  paymentDates,
const Real  notional,
const QuantLib::ext::shared_ptr< Index > &  index,
const QuantLib::ext::shared_ptr< FxIndex > &  fxIndex = nullptr 
)

Definition at line 59 of file trscashflow.cpp.

62 : valuationDates_(valuationDates), paymentDates_(paymentDates), notional_(notional), index_(index),
63 fxIndex_(fxIndex) {}
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
Definition: trscashflow.hpp:98
QuantLib::ext::shared_ptr< Index > index_
Definition: trscashflow.hpp:97
std::vector< Date > valuationDates_
Definition: trscashflow.hpp:94
std::vector< Date > paymentDates_
Definition: trscashflow.hpp:95

Member Function Documentation

◆ withInitialPrice()

TRSLeg & withInitialPrice ( Real  initialPrice)

Definition at line 65 of file trscashflow.cpp.

65 {
66 initialPrice_ = initialPrice;
67 return *this;
68}

◆ operator Leg()

operator Leg ( ) const

Definition at line 70 of file trscashflow.cpp.

70 {
71 Leg leg;
72 Real initialPrice;
73
74 for (Size i = 0; i < valuationDates_.size() - 1; ++i) {
75 initialPrice = i == 0 ? initialPrice_ : Null<Real>();
76 leg.push_back(QuantLib::ext::make_shared<TRSCashFlow>(paymentDates_[i], valuationDates_[i], valuationDates_[i + 1],
77 notional_, index_, initialPrice, fxIndex_));
78 }
79 return leg;
80}

Member Data Documentation

◆ valuationDates_

std::vector<Date> valuationDates_
private

Definition at line 94 of file trscashflow.hpp.

◆ paymentDates_

std::vector<Date> paymentDates_
private

Definition at line 95 of file trscashflow.hpp.

◆ notional_

Real notional_
private

Definition at line 96 of file trscashflow.hpp.

◆ index_

QuantLib::ext::shared_ptr<Index> index_
private

Definition at line 97 of file trscashflow.hpp.

◆ fxIndex_

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

Definition at line 98 of file trscashflow.hpp.

◆ initialPrice_

Real initialPrice_
private

Definition at line 99 of file trscashflow.hpp.