/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2005, 2006 Theo Boafo Copyright (C) 2006, 2007 StatPro Italia srl This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email . The license is also available online at . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ /*! \file convertiblebond.hpp \brief convertible bond class */ #ifndef quantlib_convertible_bond_hpp #define quantlib_convertible_bond_hpp #include #include #include #include #include #include #include #include #include #include namespace QuantLib { //! %callability leaving to the holder the possibility to convert class SoftCallability : public Callability { public: SoftCallability(const Price& price, const Date& date, Real trigger) : Callability(price, Callability::Call, date), trigger_(trigger) {} Real trigger() const { return trigger_; } private: Real trigger_; }; //! base class for convertible bonds class ConvertibleBond : public Bond { public: class option; Real conversionRatio() const { return conversionRatio_; } const DividendSchedule& dividends() const { return dividends_; } const CallabilitySchedule& callability() const { return callability_; } const Handle& creditSpread() const { return creditSpread_; } protected: ConvertibleBond(const boost::shared_ptr& process, const boost::shared_ptr& exercise, const boost::shared_ptr& engine, Real conversionRatio, const DividendSchedule& dividends, const CallabilitySchedule& callability, const Handle& creditSpread, const Date& issueDate, Natural settlementDays, const DayCounter& dayCounter, const Schedule& schedule, Real redemption); void performCalculations() const; Real conversionRatio_; CallabilitySchedule callability_; DividendSchedule dividends_; Handle creditSpread_; boost::shared_ptr