QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ForwardSwapQuote Class Reference

Quote for a forward starting swap. More...

#include <forwardswapquote.hpp>

+ Inheritance diagram for ForwardSwapQuote:
+ Collaboration diagram for ForwardSwapQuote:

Public Member Functions

 ForwardSwapQuote (ext::shared_ptr< SwapIndex > swapIndex, Handle< Quote > spread, const Period &fwdStart)
 
Quote interface
Real value () const override
 returns the current value More...
 
bool isValid () const override
 returns true if the Quote holds a valid value More...
 
- Public Member Functions inherited from Quote
 ~Quote () override=default
 
virtual Real value () const =0
 returns the current value More...
 
virtual bool isValid () const =0
 returns true if the Quote holds a valid value More...
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from LazyObject
 LazyObject ()
 
 ~LazyObject () override=default
 
bool isCalculated () const
 
void forwardFirstNotificationOnly ()
 
void alwaysForwardNotifications ()
 
void recalculate ()
 
void freeze ()
 
void unfreeze ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Observer interface

ext::shared_ptr< SwapIndexswapIndex_
 
Handle< Quotespread_
 
Period fwdStart_
 
Date evaluationDate_
 
Date valueDate_
 
Date startDate_
 
Date fixingDate_
 
ext::shared_ptr< VanillaSwapswap_
 
Rate result_
 
void update () override
 
const DatevalueDate () const
 
const DatestartDate () const
 
const DatefixingDate () const
 
void initializeDates ()
 
void performCalculations () const override
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Member Functions inherited from LazyObject
virtual void calculate () const
 
- Protected Attributes inherited from LazyObject
bool calculated_ = false
 
bool frozen_ = false
 
bool alwaysForward_
 

Detailed Description

Quote for a forward starting swap.

Definition at line 35 of file forwardswapquote.hpp.

Constructor & Destructor Documentation

◆ ForwardSwapQuote()

ForwardSwapQuote ( ext::shared_ptr< SwapIndex swapIndex,
Handle< Quote spread,
const Period fwdStart 
)

Definition at line 26 of file forwardswapquote.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ value()

Real value ( ) const
overridevirtual

returns the current value

Implements Quote.

Definition at line 72 of file forwardswapquote.cpp.

+ Here is the call graph for this function:

◆ isValid()

bool isValid ( ) const
overridevirtual

returns true if the Quote holds a valid value

Implements Quote.

Definition at line 77 of file forwardswapquote.cpp.

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Reimplemented from LazyObject.

Definition at line 49 of file forwardswapquote.cpp.

+ Here is the call graph for this function:

◆ valueDate()

const Date & valueDate ( ) const

Definition at line 57 of file forwardswapquote.cpp.

+ Here is the call graph for this function:

◆ startDate()

const Date & startDate ( ) const

Definition at line 62 of file forwardswapquote.cpp.

+ Here is the call graph for this function:

◆ fixingDate()

const Date & fixingDate ( ) const

Definition at line 67 of file forwardswapquote.cpp.

+ Here is the call graph for this function:

◆ initializeDates()

void initializeDates ( )
protected

Definition at line 37 of file forwardswapquote.cpp.

+ Here is the caller graph for this function:

◆ performCalculations()

void performCalculations ( ) const
overrideprotectedvirtual

This method must implement any calculations which must be (re)done in order to calculate the desired results.

Implements LazyObject.

Definition at line 88 of file forwardswapquote.cpp.

Member Data Documentation

◆ swapIndex_

ext::shared_ptr<SwapIndex> swapIndex_
protected

Definition at line 57 of file forwardswapquote.hpp.

◆ spread_

Handle<Quote> spread_
protected

Definition at line 58 of file forwardswapquote.hpp.

◆ fwdStart_

Period fwdStart_
protected

Definition at line 59 of file forwardswapquote.hpp.

◆ evaluationDate_

Date evaluationDate_
protected

Definition at line 61 of file forwardswapquote.hpp.

◆ valueDate_

Date valueDate_
protected

Definition at line 61 of file forwardswapquote.hpp.

◆ startDate_

Date startDate_
protected

Definition at line 61 of file forwardswapquote.hpp.

◆ fixingDate_

Date fixingDate_
protected

Definition at line 61 of file forwardswapquote.hpp.

◆ swap_

ext::shared_ptr<VanillaSwap> swap_
protected

Definition at line 62 of file forwardswapquote.hpp.

◆ result_

Rate result_
mutableprotected

Definition at line 64 of file forwardswapquote.hpp.