Composite instrument More...
#include <qle/instruments/multiccycompositeinstrument.hpp>
Public Member Functions | |
void | add (const ext::shared_ptr< Instrument > &instrument, Real multiplier=1.0, const Handle< Quote > &fx=Handle< Quote >(QuantLib::ext::make_shared< SimpleQuote >(1.0))) |
adds an instrument to the composite More... | |
void | subtract (const ext::shared_ptr< Instrument > &instrument, Real multiplier=1.0, const Handle< Quote > &fx=Handle< Quote >(QuantLib::ext::make_shared< SimpleQuote >(1.0))) |
shorts an instrument from the composite More... | |
Observer interface | |
void | deepUpdate () override |
Private Types | |
typedef std::tuple< ext::shared_ptr< Instrument >, Real, Handle< Quote > > | component |
typedef std::list< component >::iterator | iterator |
typedef std::list< component >::const_iterator | const_iterator |
Instrument interface | |
std::list< component > | components_ |
bool | isExpired () const override |
void | performCalculations () const override |
Composite instrument
This instrument is an aggregate of other instruments. Its NPV is the sum of the NPVs of its components, each possibly multiplied by a given factor, and an FX rate.
Definition at line 46 of file multiccycompositeinstrument.hpp.
|
private |
Definition at line 47 of file multiccycompositeinstrument.hpp.
Definition at line 48 of file multiccycompositeinstrument.hpp.
|
private |
Definition at line 49 of file multiccycompositeinstrument.hpp.
void add | ( | const ext::shared_ptr< Instrument > & | instrument, |
Real | multiplier = 1.0 , |
||
const Handle< Quote > & | fx = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(1.0)) |
||
) |
adds an instrument to the composite
Definition at line 24 of file multiccycompositeinstrument.cpp.
void subtract | ( | const ext::shared_ptr< Instrument > & | instrument, |
Real | multiplier = 1.0 , |
||
const Handle< Quote > & | fx = Handle<Quote>(QuantLib::ext::make_shared<SimpleQuote>(1.0)) |
||
) |
shorts an instrument from the composite
Definition at line 41 of file multiccycompositeinstrument.cpp.
|
override |
Definition at line 69 of file multiccycompositeinstrument.cpp.
|
override |
Definition at line 46 of file multiccycompositeinstrument.cpp.
|
overrideprotected |
Definition at line 54 of file multiccycompositeinstrument.cpp.
|
private |
Definition at line 70 of file multiccycompositeinstrument.hpp.