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 energyswap.hpp 21 \brief Energy swap 22 */ 23 24 #ifndef quantlib_energy_swap_hpp 25 #define quantlib_energy_swap_hpp 26 27 #include <ql/experimental/commodities/energycommodity.hpp> 28 #include <ql/experimental/commodities/pricingperiod.hpp> 29 #include <ql/experimental/commodities/commoditycashflow.hpp> 30 #include <ql/time/calendar.hpp> 31 32 namespace QuantLib { 33 34 class EnergySwap : public EnergyCommodity { 35 public: 36 EnergySwap(const Calendar& calendar, 37 const Currency& payCurrency, 38 const Currency& receiveCurrency, 39 const PricingPeriods& pricingPeriods, 40 const CommodityType& commodityType, 41 const ext::shared_ptr<SecondaryCosts>& secondaryCosts); 42 43 bool isExpired() const; calendar() const44 const Calendar& calendar() const { return calendar_; } payCurrency() const45 const Currency& payCurrency() const { return payCurrency_; } receiveCurrency() const46 const Currency& receiveCurrency() const { return receiveCurrency_; } pricingPeriods() const47 const PricingPeriods& pricingPeriods() const { return pricingPeriods_; } dailyPositions() const48 const EnergyDailyPositions& dailyPositions() const { 49 return dailyPositions_; 50 } paymentCashFlows() const51 const CommodityCashFlows& paymentCashFlows() const { 52 return paymentCashFlows_; 53 } 54 55 const CommodityType& commodityType() const; 56 Quantity quantity() const; 57 58 protected: 59 Calendar calendar_; 60 Currency payCurrency_; 61 Currency receiveCurrency_; 62 PricingPeriods pricingPeriods_; 63 mutable EnergyDailyPositions dailyPositions_; 64 mutable CommodityCashFlows paymentCashFlows_; 65 }; 66 67 } 68 69 #endif 70