QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
DateInterval Class Reference

Date interval described by a number of a given time unit. More...

#include <dateinterval.hpp>

+ Inheritance diagram for DateInterval:
+ Collaboration diagram for DateInterval:

Public Member Functions

 DateInterval ()=default
 
 DateInterval (const Date &startDate, const Date &endDate)
 
const DatestartDate () const
 
const DateendDate () const
 
bool isDateBetween (Date date, bool includeFirst=true, bool includeLast=true) const
 
DateInterval intersection (const DateInterval &di) const
 
bool operator== (const DateInterval &rhs) const
 
bool operator!= (const DateInterval &rhs) const
 

Private Attributes

Date startDate_
 
Date endDate_
 

Friends

std::ostream & operator<< (std::ostream &, const DateInterval &)
 

Detailed Description

Date interval described by a number of a given time unit.

Definition at line 35 of file dateinterval.hpp.

Constructor & Destructor Documentation

◆ DateInterval() [1/2]

DateInterval ( )
default

◆ DateInterval() [2/2]

DateInterval ( const Date startDate,
const Date endDate 
)

Definition at line 43 of file dateinterval.hpp.

Member Function Documentation

◆ startDate()

const Date & startDate ( ) const

Definition at line 48 of file dateinterval.hpp.

◆ endDate()

const Date & endDate ( ) const

Definition at line 49 of file dateinterval.hpp.

◆ isDateBetween()

bool isDateBetween ( Date  date,
bool  includeFirst = true,
bool  includeLast = true 
) const

Definition at line 51 of file dateinterval.hpp.

◆ intersection()

DateInterval intersection ( const DateInterval di) const

Definition at line 65 of file dateinterval.hpp.

◆ operator==()

bool operator== ( const DateInterval rhs) const

Definition at line 72 of file dateinterval.hpp.

◆ operator!=()

bool operator!= ( const DateInterval rhs) const

Definition at line 76 of file dateinterval.hpp.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const DateInterval di 
)
friend

Definition at line 24 of file dateinterval.cpp.

Member Data Documentation

◆ startDate_

Date startDate_
private

Definition at line 39 of file dateinterval.hpp.

◆ endDate_

Date endDate_
private

Definition at line 40 of file dateinterval.hpp.