24 const Currency& secondLegCcy)
25 : Swap(firstLeg, secondLeg) {
32 const std::vector<Currency>& currencies)
33 : Swap(legs, payer), currencies_(currencies) {
34 QL_REQUIRE(payer.size() ==
currencies_.size(),
"Size mismatch "
36 << payer.size() <<
") and currencies (" <<
currencies_.size()
41 : Swap(legs), currencies_(legs), inCcyLegNPV_(legs, 0.0), inCcyLegBPS_(legs, 0.0), npvDateDiscounts_(legs, 0.0) {}
45 Swap::setupArguments(args);
48 QL_REQUIRE(
arguments,
"The arguments are not of type "
49 "cross currency swap");
56 Swap::fetchResults(r);
59 QL_REQUIRE(
results,
"The results are not of type "
60 "cross currency swap");
64 "Wrong number of in currency leg NPVs returned by engine");
72 "Wrong number of in currency leg BPSs returned by engine");
80 "Wrong number of npv date discounts returned by engine");
95 Swap::arguments::validate();
96 QL_REQUIRE(legs.size() ==
currencies.size(),
"Number of legs is not equal to number of currencies");
100 Swap::results::reset();
std::vector< Currency > currencies
void validate() const override
std::vector< DiscountFactor > npvDateDiscounts
std::vector< Real > inCcyLegNPV
std::vector< Real > inCcyLegBPS
std::vector< Real > inCcyLegNPV_
CrossCcySwap(const Leg &firstLeg, const Currency &firstLegCcy, const Leg &secondLeg, const Currency &secondLegCcy)
First leg is paid and the second is received.
Real inCcyLegNPV(Size j) const
std::vector< DiscountFactor > npvDateDiscounts_
std::vector< Real > inCcyLegBPS_
void setupArguments(PricingEngine::arguments *args) const override
Real inCcyLegBPS(Size j) const
void setupExpired() const override
void fetchResults(const PricingEngine::results *) const override
DiscountFactor npvDateDiscounts(Size j) const
std::vector< Currency > currencies_
Swap instrument with legs involving two currencies.