Class implements calendar object. More...
#include <calendar.hpp>
Public Member Functions | |
Calendar () | |
Constructor. More... | |
Calendar (DayRollingConvention, int, const std::vector< Date > &, const std::vector< Date > &, const std::vector< SmartPointer< Holiday > > &, bool end_of_month, const SmartPointer< SettlementDateConvention > &) | |
Constructor. More... | |
bool | isBusinessDay (const Date &) const |
Method returns true if a given date is business day and false otherwise. More... | |
bool | isHoliday (const Date &) const |
Method returns true if a given date is holiday and false otherwise. More... | |
bool | isWeekend (const Date &) const |
Method returns true if a given date is a Saturday or Sunday and false otherwise. More... | |
Date | adjust (const Date &) const |
Method adjusts a date according to a given day rolling convention. More... | |
int | businessDaysBetween (const Date &, const Date &) const |
Method returns number of business days between date1 and date2. More... | |
int | numberOfHolidaysBetween (const Date &, const Date &) const |
Method returns number of holidays between date1 and date2. More... | |
Date | workingDays (const Date &, int) const |
Method returns nth working day from a given date. More... | |
Date | getSpot (const Date &) const |
Method returns spot date for a given date. More... | |
Date | getON (const Date &) const |
Method returns next working day of a calendar's date. More... | |
Date | getTN (const Date &) const |
Method returns second working day from a calendar's date. More... | |
Date | expiryDate (const Date &d, const Tenor &t) const |
Date | settlementDate (const Date &d, const Tenor &t) const |
Calculates settlement date. More... | |
int | getSpotLag () const |
bool | isEndOfMonth (const Date &) const |
Date | getLastWorkingDateOfMonth (const Date &) const |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
interface used by Boost serialization library More... | |
Private Attributes | |
int | spot_lag_ |
This integer define how many working days is between today date and spot date. More... | |
DayRollingConvention | day_rolling_convention_ |
Variable defines the day rolling convention. More... | |
bool | end_of_month_ |
Boolean variable defining if end of month convention is applied. More... | |
std::vector< Date > | business_days_ |
Vector of dates that are recognized as working dates. More... | |
std::vector< Date > | holidays_dates_ |
Vector of dates that are recognized as holidays. More... | |
std::vector< SmartPointer< Holiday > > | holidays_ |
Vector of holidays objects (see Holiday). More... | |
SmartPointer< SettlementDateConvention > | settlement_ |
This variable holds object defining settlement date convention. More... | |
Friends | |
class | boost::serialization::access |
std::ostream & | operator<< (std::ostream &, Calendar &) |
Detailed Description
Class implements calendar object.
This class provides methods for determining whether a date is a business day or a holiday. It also allows to increment or decrement a date of a given number of business days or by a given tenor. The calendar also provides methods for calculating number of working days/holidays between two dates.
Constructor & Destructor Documentation
julian::Calendar::Calendar | ( | ) |
Constructor.
Constructor creating calendar object on the basis of given date, day rolling convention and spot lag. Also three vectors that are used in process of establishing whether a day is business day are provided.
julian::Calendar::Calendar | ( | DayRollingConvention | day_rolling_convention, |
int | spot_lag, | ||
const std::vector< Date > & | business_days, | ||
const std::vector< Date > & | holidays_dates, | ||
const std::vector< SmartPointer< Holiday > > & | holidays, | ||
bool | end_of_month, | ||
const SmartPointer< SettlementDateConvention > & | settlement | ||
) |
Constructor.
Constructor creating calendar object on the basis of given date, day rolling convention and spot lag. Also three vectors that are used in process of establishing whether a day is business day are provided.
Member Function Documentation
Method adjusts a date according to a given day rolling convention.
Method returns number of business days between date1 and date2.
Method returns expiry date for a given start date and tenor. The calculation is performed according to settlement day convention provided is calendar construction process.
- Warning
- Expiry date can not be calculated for tenor like Spot Overnight, Tomorrow Next and Today.
Method calculates the last working date of the month.
Method returns next working day of a calendar's date.
Method returns spot date for a given date.
int julian::Calendar::getSpotLag | ( | ) | const |
Returns spot lag
Method returns second working day from a calendar's date.
bool julian::Calendar::isBusinessDay | ( | const Date & | input | ) | const |
Method returns true if a given date is business day and false otherwise.
bool julian::Calendar::isEndOfMonth | ( | const Date & | d | ) | const |
Method returns true if the given date is the last working day of month.
bool julian::Calendar::isHoliday | ( | const Date & | input | ) | const |
Method returns true if a given date is holiday and false otherwise.
Firstly method checks if date is listed in set of holidays vector. Secondly method check if date is listed in set of business day vector.
Lastly it checks if date is holiday according to given Holiday objects.
bool julian::Calendar::isWeekend | ( | const Date & | date | ) | const |
Method returns true if a given date is a Saturday or Sunday and false otherwise.
Method returns number of holidays between date1 and date2.
|
inlineprivate |
interface used by Boost serialization library
Calculates settlement date.
Method returns settlement date for a given start date and tenor. The calculation is performed according to settlement day convention provided is calendar construction process.
Method returns nth working day from a given date.
Friends And Related Function Documentation
|
friend |
This is overloading of std::cout<< operator that allows to print object's informations on console.
Member Data Documentation
|
private |
Vector of dates that are recognized as working dates.
|
private |
Variable defines the day rolling convention.
|
private |
Boolean variable defining if end of month convention is applied.
|
private |
Vector of holidays objects (see Holiday).
|
private |
Vector of dates that are recognized as holidays.
|
private |
This variable holds object defining settlement date convention.
|
private |
This integer define how many working days is between today date and spot date.
The documentation for this class was generated from the following files:
- C:/Unix/home/OEM/jULIAN/src/dates/calendars/calendar.hpp
- C:/Unix/home/OEM/jULIAN/src/dates/calendars/calendar.cpp