2026-04-02 16:30:33 +02:00
|
|
|
/**
|
|
|
|
|
* @file Instrument.cpp
|
|
|
|
|
* @brief @ref Instrument implementation.
|
|
|
|
|
*/
|
2026-03-08 10:15:23 +01:00
|
|
|
|
|
|
|
|
#include "Instrument.hpp"
|
|
|
|
|
|
|
|
|
|
Instrument::Instrument(double maturity, std::unique_ptr<Payoff> payoff,
|
|
|
|
|
std::unique_ptr<PricingEngine> engine) : maturity_(maturity), payoff_(std::move(payoff)), engine_
|
|
|
|
|
(std::move(engine)){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double Instrument::price() const {
|
|
|
|
|
return engine_->calculate(*this);
|
|
|
|
|
}
|
|
|
|
|
|