26#ifndef quantlib_bootstrap_helper_hpp
27#define quantlib_bootstrap_helper_hpp
29#include <ql/handle.hpp>
30#include <ql/patterns/observable.hpp>
31#include <ql/patterns/visitor.hpp>
32#include <ql/quote.hpp>
33#include <ql/quotes/simplequote.hpp>
34#include <ql/settings.hpp>
35#include <ql/time/date.hpp>
152 : quote_(
std::move(quote)), termStructure_(nullptr) {
159 termStructure_(nullptr) {}
163 QL_REQUIRE(t !=
nullptr,
"null term structure given");
169 return earliestDate_;
174 if (maturityDate_ ==
Date())
175 return latestRelevantDate();
176 return maturityDate_;
181 if (latestRelevantDate_ ==
Date())
183 return latestRelevantDate_;
188 if (pillarDate_==
Date())
195 if (latestDate_ ==
Date())
211 QL_FAIL(
"not a bootstrap-helper visitor");
233 return out <<
"MaturityPillarDate";
235 return out <<
"LastRelevantPillarDate";
237 return out <<
"CustomPillarDate";
239 QL_FAIL(
"unknown Pillar::Choice(" <<
Integer(t) <<
")");
247 template <
class Helper>
249 const ext::shared_ptr<Helper>& h1,
250 const ext::shared_ptr<Helper>& h2)
const {
251 return (h1->pillarDate() < h2->pillarDate());
degenerate base class for the Acyclic Visitor pattern
Base helper class for bootstrapping.
virtual Real impliedQuote() const =0
~BootstrapHelper() override=default
const Handle< Quote > & quote() const
virtual void accept(AcyclicVisitor &)
virtual Date earliestDate() const
earliest relevant date
virtual Date pillarDate() const
pillar date
virtual Date latestDate() const
latest date
BootstrapHelper(Real quote)
BootstrapHelper(Handle< Quote > quote)
virtual Date maturityDate() const
instrument's maturity date
virtual Date latestRelevantDate() const
latest relevant date
virtual void setTermStructure(TS *)
sets the term structure to be used for pricing
Shared handle to an observable.
Object that notifies its changes to a set of observers.
Object that gets notified when a given observable changes.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
purely virtual base class for market observables
Bootstrap helper with date schedule relative to global evaluation date.
RelativeDateBootstrapHelper(const Handle< Quote > "e)
virtual void initializeDates()=0
DateProxy & evaluationDate()
the date at which pricing is to be performed.
market element returning a stored value
static Settings & instance()
access to the unique instance
Visitor for a specific class
virtual void visit(T &)=0
bool operator()(const ext::shared_ptr< Helper > &h1, const ext::shared_ptr< Helper > &h2) const
QL_INTEGER Integer
integer number
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)
Choice
Enumeration for pillar determination alternatives.
@ CustomDate
last date relevant for instrument pricing
@ LastRelevantDate
instruments maturity date