leg.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) 2006, 2007, 2010, 2011 Ferdinando Ametrano
5  Copyright (C) 2005 Aurelien Chanudet
6  Copyright (C) 2006, 2007 Cristina Duminuco
7  Copyright (C) 2006 Giorgio Facchinetti
8 
9  This file is part of QuantLib, a free-software/open-source library
10  for financial quantitative analysts and developers - http://quantlib.org/
11 
12  QuantLib is free software: you can redistribute it and/or modify it
13  under the terms of the QuantLib license. You should have received a
14  copy of the license along with this program; if not, please email
15  <quantlib-dev@lists.sf.net>. The license is also available online at
16  <http://quantlib.org/license.shtml>.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the license for more details.
21 */
22 
23 #ifndef qla_leg_hpp
24 #define qla_leg_hpp
25 
26 #include <oh/libraryobject.hpp>
27 
28 #include <ql/types.hpp>
29 #include <ql/compounding.hpp>
30 #include <ql/cashflows/cashflows.hpp>
31 
32 namespace QuantLib {
33  class FloatingRateCouponPricer;
34  class CapFloor;
35  class Swap;
36 }
37 
38 namespace QuantLibAddin {
39  class FloatingRateCouponPricer;
40 }
41 
42 namespace QuantLibAddin {
43 
44  class Leg : public ObjectHandler::LibraryObject<QuantLib::Leg> {
45  public:
46  Leg(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
47  const std::vector<QuantLib::Real>& amounts,
48  const std::vector<QuantLib::Date>& dates,
49  bool toBeSorted,
50  bool permanent);
51  Leg(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
52  const boost::shared_ptr<QuantLib::CapFloor>& capFloor,
53  bool permanent);
54  Leg(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
55  const boost::shared_ptr<QuantLib::Swap>& swap,
56  QuantLib::Size i,
57  bool permanent);
58  void setCouponPricers(
59  const std::vector<boost::shared_ptr<QuantLibAddin::FloatingRateCouponPricer> >&);
60  std::vector<std::vector<ObjectHandler::property_t> > flowAnalysis(
61  const QuantLib::Date& d) const;
62  protected:
63  OH_LIB_CTOR(Leg, QuantLib::Leg)
64  };
65 
66  class MultiPhaseLeg : public Leg {
67  public:
68  MultiPhaseLeg(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
69  const std::vector<boost::shared_ptr<Leg> >& legs,
70  bool toBeSorted,
71  bool permanent);
72  };
73 
74  class InterestRate : public ObjectHandler::LibraryObject<QuantLib::InterestRate> {
75  public:
76  InterestRate(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
77  QuantLib::Rate r,
78  const QuantLib::DayCounter& dc,
79  QuantLib::Compounding comp,
80  QuantLib::Frequency freq,
81  bool permanent);
82  };
83 }
84 
85 #endif
Definition: leg.hpp:74
std::vector< boost::shared_ptr< CashFlow > > Leg
Definition: flowanalysis.hpp:30
void setCouponPricers(const std::vector< boost::shared_ptr< QuantLibAddin::FloatingRateCouponPricer > > &)
std::vector< std::vector< ObjectHandler::property_t > > flowAnalysis(const QuantLib::Date &d) const
Definition: leg.hpp:44
MultiPhaseLeg(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< boost::shared_ptr< Leg > > &legs, bool toBeSorted, bool permanent)
Definition: leg.hpp:66
Definition: abcd.hpp:38
InterestRate(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Rate r, const QuantLib::DayCounter &dc, QuantLib::Compounding comp, QuantLib::Frequency freq, bool permanent)
Definition: abcd.hpp:30
Leg(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< QuantLib::Real > &amounts, const std::vector< QuantLib::Date > &dates, bool toBeSorted, bool permanent)