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

Bond repo instrument. More...

#include <qle/instruments/bondrepo.hpp>

+ Inheritance diagram for BondRepo:
+ Collaboration diagram for BondRepo:

Classes

class  arguments
 

Public Types

using results = QuantLib::Instrument::results
 
using engine = QuantLib::GenericEngine< arguments, results >
 

Public Member Functions

 BondRepo (const Leg &cashLeg, const bool cashLegPays, const QuantLib::ext::shared_ptr< Bond > &security, const Real securityMultiplier)
 
void deepUpdate () override
 
bool isExpired () const override
 
void setupArguments (QuantLib::PricingEngine::arguments *) const override
 
void fetchResults (const QuantLib::PricingEngine::results *) const override
 
const Leg & cashLeg () const
 Inspectors. More...
 
bool cashLegPays () const
 
QuantLib::ext::shared_ptr< Bond > security () const
 
Real securityMultiplier () const
 

Private Member Functions

void setupExpired () const override
 

Private Attributes

const Leg cashLeg_
 
const bool cashLegPays_
 
const QuantLib::ext::shared_ptr< Bond > security_
 
const Real securityMultiplier_
 

Detailed Description

Bond repo instrument.

Definition at line 34 of file bondrepo.hpp.

Member Typedef Documentation

◆ results

Definition at line 44 of file bondrepo.hpp.

◆ engine

using engine = QuantLib::GenericEngine<arguments, results>

Definition at line 45 of file bondrepo.hpp.

Constructor & Destructor Documentation

◆ BondRepo()

BondRepo ( const Leg &  cashLeg,
const bool  cashLegPays,
const QuantLib::ext::shared_ptr< Bond > &  security,
const Real  securityMultiplier 
)

Definition at line 28 of file bondrepo.cpp.

31 for (auto const& c : cashLeg_)
32 registerWith(c);
33 registerWith(security_);
34}
bool cashLegPays() const
Definition: bondrepo.hpp:59
const Real securityMultiplier_
Definition: bondrepo.hpp:67
QuantLib::ext::shared_ptr< Bond > security() const
Definition: bondrepo.hpp:60
const QuantLib::ext::shared_ptr< Bond > security_
Definition: bondrepo.hpp:66
const Leg & cashLeg() const
Inspectors.
Definition: bondrepo.hpp:58
const bool cashLegPays_
Definition: bondrepo.hpp:65
const Leg cashLeg_
Definition: bondrepo.hpp:64
Real securityMultiplier() const
Definition: bondrepo.hpp:61

Member Function Documentation

◆ deepUpdate()

void deepUpdate ( )
override

Definition at line 36 of file bondrepo.cpp.

36 {
37 security_->deepUpdate();
38 update();
39}

◆ isExpired()

bool isExpired ( ) const
override

Definition at line 41 of file bondrepo.cpp.

41 {
42 for (auto const& c : cashLeg_)
43 if (!c->hasOccurred())
44 return false;
45 return true;
46}

◆ setupArguments()

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

Definition at line 48 of file bondrepo.cpp.

48 {
49 BondRepo::arguments* arguments = dynamic_cast<BondRepo::arguments*>(args);
50 QL_REQUIRE(arguments != 0, "BondRepo::setupArguments(): wrong argument type");
51 arguments->cashLeg = cashLeg_;
52 arguments->cashLegPays = cashLegPays_;
53 arguments->security = security_;
54 arguments->securityMultiplier = securityMultiplier_;
55}

◆ fetchResults()

void fetchResults ( const QuantLib::PricingEngine::results *  r) const
override

Definition at line 57 of file bondrepo.cpp.

57{ Instrument::fetchResults(r); }

◆ cashLeg()

const Leg & cashLeg ( ) const

Inspectors.

Definition at line 58 of file bondrepo.hpp.

58{ return cashLeg_; }

◆ cashLegPays()

bool cashLegPays ( ) const

Definition at line 59 of file bondrepo.hpp.

59{ return cashLegPays_; }

◆ security()

QuantLib::ext::shared_ptr< Bond > security ( ) const

Definition at line 60 of file bondrepo.hpp.

60{ return security_; }

◆ securityMultiplier()

Real securityMultiplier ( ) const

Definition at line 61 of file bondrepo.hpp.

61{ return securityMultiplier_; }

◆ setupExpired()

void setupExpired ( ) const
overrideprivate

Definition at line 58 of file bondrepo.cpp.

58{ Instrument::setupExpired(); }

Member Data Documentation

◆ cashLeg_

const Leg cashLeg_
private

Definition at line 64 of file bondrepo.hpp.

◆ cashLegPays_

const bool cashLegPays_
private

Definition at line 65 of file bondrepo.hpp.

◆ security_

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

Definition at line 66 of file bondrepo.hpp.

◆ securityMultiplier_

const Real securityMultiplier_
private

Definition at line 67 of file bondrepo.hpp.