| 1 | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 | |
| 3 | /* |
| 4 | Copyright (C) 2008 J. Erik Radmall |
| 5 | |
| 6 | This file is part of QuantLib, a free-software/open-source library |
| 7 | for financial quantitative analysts and developers - http://quantlib.org/ |
| 8 | |
| 9 | QuantLib is free software: you can redistribute it and/or modify it |
| 10 | under the terms of the QuantLib license. You should have received a |
| 11 | copy of the license along with this program; if not, please email |
| 12 | <quantlib-dev@lists.sf.net>. The license is also available online at |
| 13 | <http://quantlib.org/license.shtml>. |
| 14 | |
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT |
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 17 | FOR A PARTICULAR PURPOSE. See the license for more details. |
| 18 | */ |
| 19 | |
| 20 | /*! \file pricingperiod.hpp |
| 21 | \brief Pricing period |
| 22 | */ |
| 23 | |
| 24 | #ifndef quantlib_pricing_period_hpp |
| 25 | #define quantlib_pricing_period_hpp |
| 26 | |
| 27 | #include <ql/experimental/commodities/dateinterval.hpp> |
| 28 | #include <ql/experimental/commodities/quantity.hpp> |
| 29 | #include <utility> |
| 30 | #include <vector> |
| 31 | |
| 32 | namespace QuantLib { |
| 33 | |
| 34 | //! Time pricingperiod described by a number of a given time unit |
| 35 | /*! \ingroup datetime */ |
| 36 | class PricingPeriod : public DateInterval { |
| 37 | public: |
| 38 | PricingPeriod(const Date& startDate, |
| 39 | const Date& endDate, |
| 40 | const Date& paymentDate, |
| 41 | Quantity quantity) |
| 42 | : DateInterval(startDate, endDate), paymentDate_(paymentDate), |
| 43 | quantity_(std::move(quantity)) {} |
| 44 | const Date& paymentDate() const { return paymentDate_; } |
| 45 | const Quantity& quantity() const { return quantity_; } |
| 46 | private: |
| 47 | Date paymentDate_; |
| 48 | Quantity quantity_; |
| 49 | }; |
| 50 | |
| 51 | typedef std::vector<ext::shared_ptr<PricingPeriod> > PricingPeriods; |
| 52 | } |
| 53 | |
| 54 | #endif |
| 55 | |