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

Swaption class with QuantLib::Swap underlying More...

#include <qle/instruments/genericswaption.hpp>

+ Inheritance diagram for GenericSwaption:
+ Collaboration diagram for GenericSwaption:

Classes

class  arguments
 Arguments for swaption calculation More...
 
class  engine
 base class for swaption engines More...
 
class  results
 Results from CDS-option calculation More...
 

Public Member Functions

 GenericSwaption (const ext::shared_ptr< QuantLib::Swap > &swap, const ext::shared_ptr< Exercise > &exercise, QuantLib::Settlement::Type delivery=QuantLib::Settlement::Physical, QuantLib::Settlement::Method settlementMethod=QuantLib::Settlement::PhysicalOTC)
 
Instrument interface
bool isExpired () const override
 
void setupArguments (PricingEngine::arguments *) const override
 

Inspectors

ext::shared_ptr< QuantLib::Swap > swap_
 
QuantLib::Settlement::Type settlementType_
 
QuantLib::Settlement::Method settlementMethod_
 
Real underlyingValue_
 
Settlement::Type settlementType () const
 
Settlement::Method settlementMethod () const
 
const ext::shared_ptr< QuantLib::Swap > & underlyingSwap () const
 
Real underlyingValue () const
 
void fetchResults (const PricingEngine::results *) const override
 

Detailed Description

Swaption class with QuantLib::Swap underlying

Definition at line 38 of file genericswaption.hpp.

Constructor & Destructor Documentation

◆ GenericSwaption()

GenericSwaption ( const ext::shared_ptr< QuantLib::Swap > &  swap,
const ext::shared_ptr< Exercise > &  exercise,
QuantLib::Settlement::Type  delivery = QuantLib::Settlement::Physical,
QuantLib::Settlement::Method  settlementMethod = QuantLib::Settlement::PhysicalOTC 
)

Definition at line 26 of file genericswaption.cpp.

28 : Option(ext::shared_ptr<Payoff>(), exercise), swap_(swap), settlementType_(delivery),
30 registerWith(swap_);
31 swap_->alwaysForwardNotifications();
32}
ext::shared_ptr< QuantLib::Swap > swap_
QuantLib::Settlement::Type settlementType_
QuantLib::Settlement::Method settlementMethod_
Settlement::Method settlementMethod() const

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 34 of file genericswaption.cpp.

34{ return detail::simple_event(exercise_->dates().back()).hasOccurred(); }

◆ setupArguments()

void setupArguments ( PricingEngine::arguments *  args) const
override

Definition at line 36 of file genericswaption.cpp.

36 {
37 swap_->setupArguments(args);
38 Option::setupArguments(args);
39
40 GenericSwaption::arguments* arguments = dynamic_cast<GenericSwaption::arguments*>(args);
41
42 QL_REQUIRE(arguments != 0, "wrong argument type");
43
44 arguments->swap = swap_;
45 arguments->settlementType = settlementType_;
46 arguments->settlementMethod = settlementMethod_;
47 arguments->exercise = exercise_;
48}

◆ settlementType()

Settlement::Type settlementType ( ) const

Definition at line 53 of file genericswaption.hpp.

53{ return settlementType_; }
+ Here is the caller graph for this function:

◆ settlementMethod()

Settlement::Method settlementMethod ( ) const

Definition at line 54 of file genericswaption.hpp.

54{ return settlementMethod_; }
+ Here is the caller graph for this function:

◆ underlyingSwap()

const ext::shared_ptr< QuantLib::Swap > & underlyingSwap ( ) const

Definition at line 55 of file genericswaption.hpp.

55{ return swap_; }

◆ underlyingValue()

Real underlyingValue ( ) const

Definition at line 56 of file genericswaption.hpp.

◆ fetchResults()

void fetchResults ( const PricingEngine::results *  r) const
overrideprivate

Definition at line 50 of file genericswaption.cpp.

50 {
51 Option::fetchResults(r);
52 const GenericSwaption::results* results = dynamic_cast<const GenericSwaption::results*>(r);
53 QL_ENSURE(results != 0, "wrong results type");
54 underlyingValue_ = results->underlyingValue;
55}

Member Data Documentation

◆ swap_

ext::shared_ptr<QuantLib::Swap> swap_
private

Definition at line 61 of file genericswaption.hpp.

◆ settlementType_

QuantLib::Settlement::Type settlementType_
private

Definition at line 62 of file genericswaption.hpp.

◆ settlementMethod_

QuantLib::Settlement::Method settlementMethod_
private

Definition at line 63 of file genericswaption.hpp.

◆ underlyingValue_

Real underlyingValue_
mutableprivate

Definition at line 64 of file genericswaption.hpp.