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

Bond option class. More...

#include <qle/instruments/bondoption.hpp>

+ Inheritance diagram for BondOption:
+ Collaboration diagram for BondOption:

Classes

class  arguments
 
class  engine
 
class  results
 

Public Member Functions

 BondOption (const QuantLib::ext::shared_ptr< QuantLib::Bond > &underlying, const CallabilitySchedule &putCallSchedule, const bool knocksOutOnDefault=false)
 
bool isExpired () const override
 
void deepUpdate () override
 
const CallabilitySchedule & callability () const
 

Private Member Functions

void setupArguments (PricingEngine::arguments *) const override
 

Private Attributes

const QuantLib::ext::shared_ptr< QuantLib::Bond > underlying_
 
const CallabilitySchedule putCallSchedule_
 
const bool knocksOutOnDefault_
 

Detailed Description

Bond option class.

Definition at line 34 of file bondoption.hpp.

Constructor & Destructor Documentation

◆ BondOption()

BondOption ( const QuantLib::ext::shared_ptr< QuantLib::Bond > &  underlying,
const CallabilitySchedule &  putCallSchedule,
const bool  knocksOutOnDefault = false 
)

Definition at line 36 of file bondoption.hpp.

38 : underlying_(underlying), putCallSchedule_(putCallSchedule), knocksOutOnDefault_(knocksOutOnDefault) {}
const CallabilitySchedule putCallSchedule_
Definition: bondoption.hpp:55
const bool knocksOutOnDefault_
Definition: bondoption.hpp:56
const QuantLib::ext::shared_ptr< QuantLib::Bond > underlying_
Definition: bondoption.hpp:54

Member Function Documentation

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 23 of file bondoption.cpp.

23{ return putCallSchedule_.back()->hasOccurred(); }

◆ deepUpdate()

void deepUpdate ( )
override

Definition at line 41 of file bondoption.hpp.

41 {
42 underlying_->update();
43 this->update();
44 }

◆ callability()

const CallabilitySchedule & callability ( ) const

Definition at line 46 of file bondoption.hpp.

46{ return putCallSchedule_; }

◆ setupArguments()

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

Definition at line 25 of file bondoption.cpp.

25 {
26 BondOption::arguments* arguments = dynamic_cast<BondOption::arguments*>(args);
27 QL_REQUIRE(arguments != 0, "wrong argument type");
28 arguments->underlying = underlying_;
29 arguments->putCallSchedule = putCallSchedule_;
30 arguments->knocksOutOnDefault = knocksOutOnDefault_;
31}

Member Data Documentation

◆ underlying_

const QuantLib::ext::shared_ptr<QuantLib::Bond> underlying_
private

Definition at line 54 of file bondoption.hpp.

◆ putCallSchedule_

const CallabilitySchedule putCallSchedule_
private

Definition at line 55 of file bondoption.hpp.

◆ knocksOutOnDefault_

const bool knocksOutOnDefault_
private

Definition at line 56 of file bondoption.hpp.