25#ifndef quantlib_day_counter_hpp
26#define quantlib_day_counter_hpp
50 virtual std::string
name()
const = 0;
53 const Date& d2)
const {
58 const Date& refPeriodStart,
59 const Date& refPeriodEnd)
const = 0;
82 std::string
name()
const;
89 const Date& refPeriodEnd =
Date())
const;
119 return impl_->name();
123 const Date& d2)
const {
125 return impl_->dayCount(d1,d2);
129 const Date& refPeriodStart,
const Date& refPeriodEnd)
const {
131 return impl_->yearFraction(d1,d2,refPeriodStart,refPeriodEnd);
145 return out <<
d.name();
std::int_fast32_t serial_type
serial number type
abstract base class for day counter implementations
virtual Date::serial_type dayCount(const Date &d1, const Date &d2) const
to be overloaded by more complex day counters
virtual std::string name() const =0
virtual Time yearFraction(const Date &d1, const Date &d2, const Date &refPeriodStart, const Date &refPeriodEnd) const =0
Date::serial_type dayCount(const Date &, const Date &) const
Returns the number of days between two dates.
std::string name() const
Returns the name of the day counter.
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
bool empty() const
Returns whether or not the day counter is initialized.
ext::shared_ptr< Impl > impl_
DayCounter(ext::shared_ptr< Impl > impl)
date- and time-related classes, typedefs and enumerations
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
bool operator==(const Currency &c1, const Currency &c2)
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)
bool operator!=(const Currency &c1, const Currency &c2)