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

Bespoke calendar. More...

#include <bespokecalendar.hpp>

+ Inheritance diagram for BespokeCalendar:
+ Collaboration diagram for BespokeCalendar:

Classes

class  Impl
 

Public Member Functions

 BespokeCalendar (const std::string &name="")
 
void addWeekend (Weekday)
 marks the passed day as part of the weekend More...
 
- Public Member Functions inherited from Calendar
 Calendar ()=default
 
bool empty () const
 Returns whether or not the calendar is initialized. More...
 
std::string name () const
 Returns the name of the calendar. More...
 
const std::set< Date > & addedHolidays () const
 
const std::set< Date > & removedHolidays () const
 
void resetAddedAndRemovedHolidays ()
 
bool isBusinessDay (const Date &d) const
 
bool isHoliday (const Date &d) const
 
bool isWeekend (Weekday w) const
 
bool isEndOfMonth (const Date &d) const
 
Date endOfMonth (const Date &d) const
 last business day of the month to which the given date belongs More...
 
void addHoliday (const Date &)
 
void removeHoliday (const Date &)
 
std::vector< DateholidayList (const Date &from, const Date &to, bool includeWeekEnds=false) const
 
std::vector< DatebusinessDayList (const Date &from, const Date &to) const
 
Date adjust (const Date &, BusinessDayConvention convention=Following) const
 
Date advance (const Date &, Integer n, TimeUnit unit, BusinessDayConvention convention=Following, bool endOfMonth=false) const
 
Date advance (const Date &date, const Period &period, BusinessDayConvention convention=Following, bool endOfMonth=false) const
 
Date::serial_type businessDaysBetween (const Date &from, const Date &to, bool includeFirst=true, bool includeLast=false) const
 

Private Attributes

ext::shared_ptr< BespokeCalendar::ImplbespokeImpl_
 

Additional Inherited Members

- Protected Attributes inherited from Calendar
ext::shared_ptr< Implimpl_
 

Detailed Description

Bespoke calendar.

This calendar has no predefined set of business days. Holidays and weekdays can be defined by means of the provided interface. Instances constructed by copying remain linked to the original one; adding a new holiday or weekday will affect all linked instances.

Definition at line 40 of file bespokecalendar.hpp.

Constructor & Destructor Documentation

◆ BespokeCalendar()

BespokeCalendar ( const std::string &  name = "")
Warning:
different bespoke calendars created with the same name (or different bespoke calendars created with no name) will compare as equal.

Definition at line 45 of file bespokecalendar.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ addWeekend()

void addWeekend ( Weekday  w)

marks the passed day as part of the weekend

Definition at line 51 of file bespokecalendar.cpp.

Member Data Documentation

◆ bespokeImpl_

ext::shared_ptr<BespokeCalendar::Impl> bespokeImpl_
private

Definition at line 53 of file bespokecalendar.hpp.