Swap (3) Linux Manual Page
QuantLib::Swap – Interest rate swap.
Synopsis
#include <ql/instruments/swap.hpp>Inherits QuantLib::Instrument.
Inherited by AssetSwap, BMASwap, and VanillaSwap.
Public Member Functions
ConstructorsSwap (const Leg &firstLeg, const Leg &secondLeg)
Swap (const std::vector< Leg > &legs, const std::vector< bool > &payer)
Instrument interface
bool isExpired () const
returns whether the instrument is still tradable.
void setupArguments (PricingEngine::arguments *) const
void fetchResults (const PricingEngine::results *) const
Additional interface
Date startDate () const
Date maturityDate () const
Real legBPS (Size j) const
Real legNPV (Size j) const
const Leg & leg (Size j) const
Protected Member Functions
ConstructorsSwap (Size legs)
Instrument interface
void setupExpired () const
Protected Attributes
std::vector< Leg > legs_std::vector< Real > payer_
std::vector< Real > legNPV_
std::vector< Real > legBPS_
Detailed Description
Interest rate swap. The cash flows belonging to the first leg are paid; the ones belonging to the second leg are received.
Constructor & Destructor Documentation
Swap (const Leg & firstLeg, const Leg & secondLeg)
The cash flows belonging to the first leg are paid; the ones belonging to the second leg are received.Swap (const std::vector< Leg > & legs, const std::vector< bool > & payer)
Multi leg constructor.Swap (Size legs) [protected]
This constructor can be used by derived classes that will build their legs themselves.Member Function Documentation
void setupArguments (PricingEngine::arguments *) const [virtual]
When a derived argument structure is defined for an instrument, this method should be overridden to fill it. This is mandatory in case a pricing engine is used.Reimplemented from Instrument.
Reimplemented in AssetSwap, and VanillaSwap.
void fetchResults (const PricingEngine::results * r) const [virtual]
When a derived result structure is defined for an instrument, this method should be overridden to read from it. This is mandatory in case a pricing engine is used.Reimplemented from Instrument.
Reimplemented in AssetSwap, and VanillaSwap.
void setupExpired () const [protected, virtual]
This method must leave the instrument in a consistent state when the expiration condition is met.Reimplemented from Instrument.
