Instrument Wrapper. More...
#include <ored/portfolio/instrumentwrapper.hpp>
Public Member Functions | |
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... | |
Protected Member Functions | |
Real | getTimedNPV (const QuantLib::ext::shared_ptr< QuantLib::Instrument > &instr) const |
Protected Attributes | |
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 |
Instrument Wrapper.
Wrap Instrument base class Derived classes should
Definition at line 47 of file instrumentwrapper.hpp.
Definition at line 24 of file instrumentwrapper.cpp.
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>() |
||
) |
Definition at line 26 of file instrumentwrapper.cpp.
|
virtual |
Definition at line 55 of file instrumentwrapper.hpp.
|
pure virtual |
Initialise with the given date grid.
Implemented in VanillaInstrument, BondPositionInstrumentWrapper, CompositeInstrumentWrapper, and OptionWrapper.
|
pure virtual |
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
Implemented in BondPositionInstrumentWrapper, CompositeInstrumentWrapper, VanillaInstrument, and OptionWrapper.
|
pure virtual |
Return the NPV of this instrument.
Implemented in BarrierOptionWrapper, BondPositionInstrumentWrapper, CompositeInstrumentWrapper, VanillaInstrument, and OptionWrapper.
|
pure virtual |
Return the additional results of this instrument.
Implemented in BarrierOptionWrapper, BondPositionInstrumentWrapper, CompositeInstrumentWrapper, VanillaInstrument, and OptionWrapper.
QuantLib::Real additionalInstrumentsNPV | ( | ) | const |
Definition at line 36 of file instrumentwrapper.cpp.
|
virtual |
call update on enclosed instrument(s)
Reimplemented in BondPositionInstrumentWrapper, CompositeInstrumentWrapper, and OptionWrapper.
Definition at line 43 of file instrumentwrapper.cpp.
|
virtual |
is it an Option?
Reimplemented in CompositeInstrumentWrapper, and OptionWrapper.
Definition at line 50 of file instrumentwrapper.cpp.
QuantLib::ext::shared_ptr< QuantLib::Instrument > qlInstrument | ( | const bool | calculate = false | ) | const |
Inspectors.
The "QuantLib" instrument Pass true if you trigger a calculation on the returned instrument and want to record the timing for that calculation. If in doubt whether a calculation is triggered, pass false.
Definition at line 52 of file instrumentwrapper.cpp.
Real multiplier | ( | ) | const |
|
virtual |
multiplier to be applied on top of multiplier(), e.g. -1 for short options
Reimplemented in OptionWrapper.
Definition at line 61 of file instrumentwrapper.cpp.
const std::vector< QuantLib::ext::shared_ptr< QuantLib::Instrument > > & additionalInstruments | ( | ) | const |
additional instruments
Definition at line 63 of file instrumentwrapper.cpp.
const std::vector< Real > & additionalMultipliers | ( | ) | const |
boost::timer::nanosecond_type getCumulativePricingTime | ( | ) | const |
Get cumulative timing spent on pricing.
Definition at line 69 of file instrumentwrapper.cpp.
std::size_t getNumberOfPricings | ( | ) | const |
Get number of pricings.
Definition at line 71 of file instrumentwrapper.cpp.
void resetPricingStats | ( | ) | const |
Reset pricing statistics.
Definition at line 73 of file instrumentwrapper.cpp.
|
protected |
Definition at line 78 of file instrumentwrapper.cpp.
|
protected |
Definition at line 109 of file instrumentwrapper.hpp.
|
protected |
Definition at line 110 of file instrumentwrapper.hpp.
|
protected |
Definition at line 111 of file instrumentwrapper.hpp.
|
protected |
Definition at line 112 of file instrumentwrapper.hpp.
|
mutableprotected |
Definition at line 117 of file instrumentwrapper.hpp.
|
mutableprotected |
Definition at line 118 of file instrumentwrapper.hpp.