assetswap.hpp
Go to the documentation of this file.
1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 /*
4  Copyright (C) 2011 Ferdinando Ametrano
5  Copyright (C) 2006 Chiara Fornarola
6 
7  This file is part of QuantLib, a free-software/open-source library
8  for financial quantitative analysts and developers - http://quantlib.org/
9 
10  QuantLib is free software: you can redistribute it and/or modify it
11  under the terms of the QuantLib license. You should have received a
12  copy of the license along with this program; if not, please email
13  <quantlib-dev@lists.sf.net>. The license is also available online at
14  <http://quantlib.org/license.shtml>.
15 
16  This program is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18  FOR A PARTICULAR PURPOSE. See the license for more details.
19 */
20 
21 #ifndef qla_asset_swap_hpp
22 #define qla_asset_swap_hpp
23 
24 #include <qlo/swap.hpp>
25 
26 namespace QuantLib {
27  class Bond;
28 }
29 
30 namespace QuantLibAddin {
31 
32  class AssetSwap : public Swap {
33  public:
34  AssetSwap(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
35  bool payFixedRate,
36  const boost::shared_ptr<QuantLib::Bond>& bond,
37  QuantLib::Real bondCleanPrice,
38  const boost::shared_ptr<QuantLib::IborIndex>& iborIndex,
39  QuantLib::Spread spread,
40  const boost::shared_ptr<QuantLib::Schedule>& floatSchedule,
41  const QuantLib::DayCounter& floatingDayCounter,
42  bool parSwap,
43  bool permanent);
44  AssetSwap(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
45  bool parAssetSwap,
46  const boost::shared_ptr<QuantLib::Bond>& bond,
47  QuantLib::Real bondCleanPrice,
48  QuantLib::Real nonParRepayment,
49  QuantLib::Real gearing,
50  const boost::shared_ptr<QuantLib::IborIndex>& iborIndex,
51  QuantLib::Spread spread,
52  const QuantLib::DayCounter& floatingDayCounter,
53  const QuantLib::Date& dealMaturity,
54  bool payFixedRate,
55  bool permanent);
56 
57  std::vector<std::vector<ObjectHandler::property_t> > bondLeg(
58  const QuantLib::Date& d) {
59  return Swap::legAnalysis(0, d);
60  }
61 
62  std::vector<std::vector<ObjectHandler::property_t> > floatingLeg(
63  const QuantLib::Date& d) {
64  return Swap::legAnalysis(1, d);
65  }
66 
67  };
68 }
69 
70 #endif
AssetSwap(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, bool payFixedRate, const boost::shared_ptr< QuantLib::Bond > &bond, QuantLib::Real bondCleanPrice, const boost::shared_ptr< QuantLib::IborIndex > &iborIndex, QuantLib::Spread spread, const boost::shared_ptr< QuantLib::Schedule > &floatSchedule, const QuantLib::DayCounter &floatingDayCounter, bool parSwap, bool permanent)
std::vector< std::vector< ObjectHandler::property_t > > floatingLeg(const QuantLib::Date &d)
Definition: assetswap.hpp:62
Definition: assetswap.hpp:32
std::vector< std::vector< ObjectHandler::property_t > > bondLeg(const QuantLib::Date &d)
Definition: assetswap.hpp:57
Definition: abcd.hpp:38
Definition: abcd.hpp:30
std::vector< std::vector< ObjectHandler::property_t > > legAnalysis(QuantLib::Size i, const QuantLib::Date &d)
Definition: swap.hpp:35