Logo
Reference manual - version ored_version
Public Member Functions | Protected Attributes | List of all members
CompositeInstrumentWrapper Class Reference

Composite Instrument Wrapper. More...

#include <ored/portfolio/compositeinstrumentwrapper.hpp>

+ Inheritance diagram for CompositeInstrumentWrapper:

Public Member Functions

 CompositeInstrumentWrapper (const std::vector< boost::shared_ptr< InstrumentWrapper >> &wrappers, const std::vector< Handle< Quote >> &fxRates={}, const Date &valuationDate=Date())
 
void initialise (const std::vector< QuantLib::Date > &dates) override
 Initialise with the given date grid.
 
void reset () override
 reset is called every time a new path is about to be priced. More...
 
QuantLib::Real NPV () const override
 Return the NPV of this instrument.
 
const std::map< std::string, boost::any > & additionalResults () const override
 Return the additional results of this instrument.
 
void updateQlInstruments () override
 call update on enclosed instrument(s)
 
bool isOption () override
 is it an Option?
 
- Public Member Functions inherited from InstrumentWrapper
 InstrumentWrapper (const boost::shared_ptr< QuantLib::Instrument > &inst, const Real multiplier=1.0, const std::vector< boost::shared_ptr< QuantLib::Instrument >> &additionalInstruments=std::vector< boost::shared_ptr< QuantLib::Instrument >>(), const std::vector< Real > &additionalMultipliers=std::vector< Real >())
 
QuantLib::Real additionalInstrumentsNPV () const
 
boost::shared_ptr< QuantLib::Instrument > qlInstrument (const bool calculate=false) const
 Inspectors. More...
 
Real multiplier () const
 
virtual Real multiplier2 () const
 
const std::vector< boost::shared_ptr< QuantLib::Instrument > > & additionalInstruments () const
 
const std::vector< Real > & additionalMultipliers () const
 
boost::timer::nanosecond_type getCumulativePricingTime () const
 Get cumulative timing spent on pricing.
 
std::size_t getNumberOfPricings () const
 Get number of pricings.
 
void resetPricingStats () const
 Reset pricing statistics.
 

Protected Attributes

bool isOption_
 
std::vector< boost::shared_ptr< InstrumentWrapper > > wrappers_
 
std::vector< QuantLib::Handle< Quote > > fxRates_
 
Date valuationDate_
 
std::map< std::string, boost::any > additionalResults_
 
- Protected Attributes inherited from InstrumentWrapper
boost::shared_ptr< QuantLib::Instrument > instrument_
 
Real multiplier_
 
std::vector< boost::shared_ptr< QuantLib::Instrument > > additionalInstruments_
 
std::vector< Real > additionalMultipliers_
 
std::size_t numberOfPricings_ = 0
 
boost::timer::nanosecond_type cumulativePricingTime_ = 0
 

Additional Inherited Members

- Protected Member Functions inherited from InstrumentWrapper
Real getTimedNPV (const boost::shared_ptr< QuantLib::Instrument > &instr) const
 

Detailed Description

Composite Instrument Wrapper.

A Composite Instrument Wrapper will return the sum npv for all wrappers passed in. Notice that qlInstrument() will return a nullptr.

Member Function Documentation

◆ reset()

void reset ( )
overridevirtual

reset is called every time a new path is about to be priced.

For path dependent Wrappers, this is when internal state should be reset

Implements InstrumentWrapper.