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

Vanilla Instrument Wrapper. More...

#include <ored/portfolio/instrumentwrapper.hpp>

+ Inheritance diagram for VanillaInstrument:
+ Collaboration diagram for VanillaInstrument:

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from InstrumentWrapper
Real getTimedNPV (const QuantLib::ext::shared_ptr< QuantLib::Instrument > &instr) const
 
- Protected Attributes inherited from InstrumentWrapper
QuantLib::ext::shared_ptr< QuantLib::Instrument > instrument_
 
Real multiplier_
 
std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > additionalInstruments_
 
std::vector< Real > additionalMultipliers_
 
std::size_t numberOfPricings_ = 0
 
boost::timer::nanosecond_type cumulativePricingTime_ = 0
 

Detailed Description

Vanilla Instrument Wrapper.

Derived from InstrumentWrapper Used for any non path-dependent trades

Definition at line 128 of file instrumentwrapper.hpp.

Constructor & Destructor Documentation

◆ VanillaInstrument()

VanillaInstrument ( const QuantLib::ext::shared_ptr< QuantLib::Instrument > &  inst,
const Real  multiplier = 1.0,
const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > &  additionalInstruments = std::vector<QuantLib::ext::shared_ptr<QuantLib::Instrument>>(),
const std::vector< Real > &  additionalMultipliers = std::vector<Real>() 
)

Definition at line 90 of file instrumentwrapper.cpp.

const std::vector< Real > & additionalMultipliers() const
const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > & additionalInstruments() const

Member Function Documentation

◆ initialise()

void initialise ( const std::vector< QuantLib::Date > &  dates)
overridevirtual

Initialise with the given date grid.

Implements InstrumentWrapper.

Definition at line 135 of file instrumentwrapper.hpp.

135{};

◆ 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.

Definition at line 136 of file instrumentwrapper.hpp.

136{}

◆ NPV()

QuantLib::Real NPV ( ) const
overridevirtual

Return the NPV of this instrument.

Implements InstrumentWrapper.

Definition at line 95 of file instrumentwrapper.cpp.

95 {
97}
QuantLib::Real additionalInstrumentsNPV() const
Real getTimedNPV(const QuantLib::ext::shared_ptr< QuantLib::Instrument > &instr) const
QuantLib::ext::shared_ptr< QuantLib::Instrument > instrument_
+ Here is the call graph for this function:

◆ additionalResults()

const std::map< std::string, boost::any > & additionalResults ( ) const
overridevirtual

Return the additional results of this instrument.

Implements InstrumentWrapper.

Definition at line 99 of file instrumentwrapper.cpp.

99 {
100 static std::map<std::string, boost::any> empty;
101 if (instrument_ == nullptr)
102 return empty;
104 return instrument_->additionalResults();
105}
+ Here is the call graph for this function: