Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

bool QuantLib::Event::hasOccurred ( const Date refDate = Date(),
boost::optional< bool >  includeRefDate = boost::none 
) const [virtual, inherited]

returns true if an event has already occurred before a date

If includeRefDate is true, then an event has not occurred if its date is the same as the refDate, i.e. this method returns false if the event date is the same as the refDate.

Reimplemented in QuantLib::CashFlow.

Definition at line 26 of file event.cpp.

References QuantLib::Event::date(), QuantLib::Settings::evaluationDate(), QuantLib::Settings::includeReferenceDateCashFlows(), and QuantLib::Singleton< Settings >::instance().

Referenced by QuantLib::VarianceSwap::isExpired(), QuantLib::ForwardRateAgreement::isExpired(), QuantLib::Forward::isExpired(), QuantLib::VarianceOption::isExpired(), QuantLib::PathMultiAssetOption::isExpired(), QuantLib::RiskyBond::isExpired(), QuantLib::RiskyAssetSwapOption::isExpired(), and QuantLib::FailureToPayEvent::matchesEventType().

        Date refDate =
            d != Date() ? d : Settings::instance().evaluationDate();
        bool includeTodaysEvent =
            includeToday ? *includeToday :
        if (includeTodaysEvent)
            return date() < refDate;
            return date() <= refDate;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index