Skip to content

Commit 4ea5a52

Browse files
pcaspersjenkins
authored andcommitted
QPR-12275 const correctness, use set method
1 parent 5350c9e commit 4ea5a52

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

OREData/ored/portfolio/fxforward.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class FxForward : public Trade {
3838
//! Default constructor
3939
FxForward() : Trade("FxForward"), boughtAmount_(0.0), soldAmount_(0.0) {}
4040
//! Constructor
41-
FxForward(Envelope& env, const string& maturityDate, const string& boughtCurrency, double boughtAmount,
41+
FxForward(const Envelope& env, const string& maturityDate, const string& boughtCurrency, double boughtAmount,
4242
const string& soldCurrency, double soldAmount, const string& settlement = "Physical",
4343
const string& fxIndex = "", const string& payDate = "")
4444
: Trade("FxForward", env), maturityDate_(maturityDate), boughtCurrency_(boughtCurrency),

OREData/ored/portfolio/fxoption.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class FxOption : public VanillaOptionTrade {
4040
//! Default constructor
4141
FxOption() : VanillaOptionTrade(AssetClass::FX) { tradeType_ = "FxOption"; }
4242
//! Constructor
43-
FxOption(Envelope& env, OptionData option, string boughtCurrency, double boughtAmount, string soldCurrency,
44-
double soldAmount, const std::string& fxIndex = "")
43+
FxOption(const Envelope& env, const OptionData& option, const string& boughtCurrency, double boughtAmount,
44+
const string& soldCurrency, double soldAmount, const std::string& fxIndex = "")
4545
: VanillaOptionTrade(env, AssetClass::FX, option, boughtCurrency, soldCurrency, boughtAmount,
4646
TradeStrike(soldAmount / boughtAmount, soldCurrency)),
4747
fxIndex_(fxIndex) {

OREData/ored/portfolio/fxswap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class FxSwap : public Trade {
3939
FxSwap()
4040
: Trade("FxSwap"), nearBoughtAmount_(0.0), nearSoldAmount_(0.0), farBoughtAmount_(0.0), farSoldAmount_(0.0) {}
4141
//! Constructor
42-
FxSwap(Envelope& env, const string& nearDate, const string& farDate, const string& nearBoughtCurrency,
42+
FxSwap(const Envelope& env, const string& nearDate, const string& farDate, const string& nearBoughtCurrency,
4343
double nearBoughtAmount, const string& nearSoldCurrency, double nearSoldAmount, double farBoughtAmount,
4444
double farSoldAmount, const string& settlement = "Physical")
4545
: Trade("FxSwap", env), nearDate_(nearDate), farDate_(farDate), nearBoughtCurrency_(nearBoughtCurrency),

OREData/ored/portfolio/portfolio.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void Portfolio::fromXML(XMLNode* node) {
8282
// copy id and envelope
8383
failedTrade->id() = id;
8484
failedTrade->setUnderlyingTradeType(tradeType);
85-
failedTrade->envelope() = trade->envelope();
85+
failedTrade->setEnvelope(trade->envelope());
8686
// and add it to the portfolio
8787
add(failedTrade);
8888
WLOG("Added trade id " << failedTrade->id() << " type " << failedTrade->tradeType()
@@ -285,7 +285,7 @@ std::pair<boost::shared_ptr<Trade>, bool> buildTrade(boost::shared_ptr<Trade>& t
285285
boost::shared_ptr<FailedTrade> failed = boost::make_shared<FailedTrade>();
286286
failed->id() = trade->id();
287287
failed->setUnderlyingTradeType(trade->tradeType());
288-
failed->envelope() = trade->envelope();
288+
failed->setEnvelope(trade->envelope());
289289
failed->build(engineFactory);
290290
failed->resetPricingStats(trade->getNumberOfPricings(), trade->getCumulativePricingTime());
291291
LOG("Built failed trade with id " << failed->id());

0 commit comments

Comments
 (0)