#include <ql/calendar.hpp>
Inheritance diagram for Calendar:
[legend]List of all members.
Detailed Description
calendar class
This class provides methods for determining whether a date is a business day or a holiday for a given market, and for incrementing/decrementing a date of a given number of business days.
The Bridge pattern is used to provide the base behavior of the calendar, namely, to determine whether a date is a business day.
A calendar should be defined for specific exchange holiday schedule or for general country holiday schedule. Legacy city holiday schedule calendars will be moved to the exchange/country convention.
- Tests:
- the methods for adding and removing holidays are tested by inspecting the calendar before and after their invocation.
Constructor & Destructor Documentation
|
This default constructor returns a calendar with a null implementation, which is therefore unusable except as a placeholder. |
|
This protected constructor will only be invoked by derived classes which define a given Calendar implementation |
Member Function Documentation
std::string name |
( |
|
) |
const |
|
|
Returns the name of the calendar.
- Warning:
- This method is used for output and comparison between calendars. It is not meant to be used for writing switch-on-type code.
|
bool isBusinessDay |
( |
const Date & |
d |
) |
const |
|
|
Returns true iff the date is a business day for the given market. |
bool isHoliday |
( |
const Date & |
d |
) |
const |
|
|
Returns true iff the date is a holiday for the given market. |
bool isEndOfMonth |
( |
const Date & |
d |
) |
const |
|
|
Returns true iff the date is last business day for the month in given market. |
void addHoliday |
( |
const Date & |
|
) |
|
|
|
Adds a date to the set of holidays for the given calendar. |
void removeHoliday |
( |
const Date & |
|
) |
|
|
|
Removes a date from the set of holidays for the given calendar. |
|
Adjusts a non-business day to the appropriate near business day with respect to the given convention. |
|
Advances the given date of the given number of business days and returns the result. - Note:
- The input date is not modified.
|
|
Advances the given date as specified by the given period and returns the result. - Note:
- The input date is not modified.
|
Friends And Related Function Documentation
|
Returns true iff the two calendars belong to the same derived class. |
|