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

#include <ored/portfolio/legbuilders.hpp>

+ Inheritance diagram for YYLegBuilder:
+ Collaboration diagram for YYLegBuilder:

Public Member Functions

 YYLegBuilder ()
 
Leg buildLeg (const LegData &data, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, RequiredFixings &requiredFixings, const string &configuration, const QuantLib::Date &openEndDateReplacement=Null< Date >(), const bool useXbsCurves=false) const override
 
- Public Member Functions inherited from LegBuilder
 LegBuilder (const string &legType)
 
virtual ~LegBuilder ()
 
virtual Leg buildLeg (const LegData &data, const QuantLib::ext::shared_ptr< EngineFactory > &, RequiredFixings &requiredFixings, const string &configuration, const QuantLib::Date &openEndDateReplacement=Null< Date >(), const bool useXbsCurves=false) const =0
 
const string & legType () const
 

Detailed Description

Definition at line 79 of file legbuilders.hpp.

Constructor & Destructor Documentation

◆ YYLegBuilder()

Definition at line 81 of file legbuilders.hpp.

81: LegBuilder("YY") {}
LegBuilder(const string &legType)

Member Function Documentation

◆ buildLeg()

Leg buildLeg ( const LegData data,
const QuantLib::ext::shared_ptr< EngineFactory > &  engineFactory,
RequiredFixings requiredFixings,
const string &  configuration,
const QuantLib::Date &  openEndDateReplacement = Null<Date>(),
const bool  useXbsCurves = false 
) const
overridevirtual

Implements LegBuilder.

Definition at line 171 of file legbuilders.cpp.

173 {
174 auto yyData = QuantLib::ext::dynamic_pointer_cast<YoYLegData>(data.concreteLegData());
175 QL_REQUIRE(yyData, "Wrong LegType, expected YY");
176 string inflationIndexName = yyData->index();
177 bool irregularYoY = yyData->irregularYoY();
178 Leg result;
179 if (!irregularYoY) {
180 auto index = *engineFactory->market()->yoyInflationIndex(inflationIndexName, configuration);
181 result = makeYoYLeg(data, index, engineFactory, openEndDateReplacement);
182 applyIndexing(result, data, engineFactory, requiredFixings, openEndDateReplacement, useXbsCurves);
184 QuantLib::ext::make_shared<FixingDateGetter>(requiredFixings));
185 } else {
186 auto index = *engineFactory->market()->zeroInflationIndex(inflationIndexName, configuration);
187 result = makeYoYLeg(data, index, engineFactory, openEndDateReplacement);
188 applyIndexing(result, data, engineFactory, requiredFixings, openEndDateReplacement, useXbsCurves);
189 addToRequiredFixings(result, QuantLib::ext::make_shared<FixingDateGetter>(requiredFixings));
190 }
191 return result;
192}
@ data
Definition: log.hpp:77
void applyIndexing(Leg &leg, const LegData &data, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, RequiredFixings &requiredFixings, const QuantLib::Date &openEndDateReplacement, const bool useXbsCurves)
Definition: legdata.cpp:2633
void addToRequiredFixings(const QuantLib::Leg &leg, const QuantLib::ext::shared_ptr< FixingDateGetter > &fixingDateGetter)
Leg makeYoYLeg(const LegData &data, const QuantLib::ext::shared_ptr< InflationIndex > &index, const QuantLib::ext::shared_ptr< EngineFactory > &engineFactory, const QuantLib::Date &openEndDateReplacement)
Definition: legdata.cpp:1766
+ Here is the call graph for this function: