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

Helper class so that the spot price can be pulled from the price curve each time the spot price is requested. More...

#include <qle/termstructures/pricetermstructure.hpp>

+ Inheritance diagram for DerivedPriceQuote:
+ Collaboration diagram for DerivedPriceQuote:

Public Member Functions

 DerivedPriceQuote (const QuantLib::Handle< PriceTermStructure > &priceTs)
 
Quote interface
QuantLib::Real value () const override
 
bool isValid () const override
 

Observer interface

QuantLib::Handle< PriceTermStructurepriceTs_
 
void update () override
 

Detailed Description

Helper class so that the spot price can be pulled from the price curve each time the spot price is requested.

Definition at line 86 of file pricetermstructure.hpp.

Constructor & Destructor Documentation

◆ DerivedPriceQuote()

DerivedPriceQuote ( const QuantLib::Handle< PriceTermStructure > &  priceTs)

Definition at line 57 of file pricetermstructure.cpp.

57 : priceTs_(priceTs) {
58 registerWith(priceTs_);
59}
QuantLib::Handle< PriceTermStructure > priceTs_

Member Function Documentation

◆ value()

Real value ( ) const
override

Definition at line 61 of file pricetermstructure.cpp.

61 {
62 QL_REQUIRE(isValid(), "Invalid DerivedPriceQuote");
63 return priceTs_->price(0, true);
64}
bool isValid() const override
+ Here is the call graph for this function:

◆ isValid()

bool isValid ( ) const
override

Definition at line 66 of file pricetermstructure.cpp.

66{ return !priceTs_.empty(); }
+ Here is the caller graph for this function:

◆ update()

void update ( )
override

Definition at line 68 of file pricetermstructure.cpp.

68{ notifyObservers(); }

Member Data Documentation

◆ priceTs_

QuantLib::Handle<PriceTermStructure> priceTs_
private

Definition at line 103 of file pricetermstructure.hpp.