calendarBuilder.hpp
Go to the documentation of this file.
1 #ifndef JULIAN_CALENDARBUILDER_HPP
2 #define JULIAN_CALENDARBUILDER_HPP
3 
4 #include <dates/date.hpp>
5 #include <iostream>
6 #include <dates/tenor.hpp>
7 #include <dates/timeUnit.hpp>
8 #include <vector>
11 
12 namespace julian {
13 
32  class BuildCalendar {
33  public:
34  BuildCalendar();
35 
37  BuildCalendar& withSpotLag(const int spot_lag);
38  BuildCalendar& addHoliday(const Date& holiday);
39  BuildCalendar& addHoliday(const NameOfMonth month,const int day);
41  BuildCalendar& removeHoliday(const Date& business_day);
44 
45  operator Calendar();
46 
47  private:
52  int spot_lag_;
60  std::vector<Date> business_days_vector_;
64  std::vector<Date> holidays_vector_;
68  std::vector<SmartPointer<Holiday> > holidays_;
75  };
76 }
77 #endif
BuildCalendar & withConvention(const DayRollingConvention &convention)
Set convention.
Definition: calendarBuilder.cpp:26
std::vector< Date > business_days_vector_
working days
Definition: calendarBuilder.hpp:60
BuildCalendar & withSettlementDateConvention(SmartPointer< SettlementDateConvention >)
sets settlement convention
Definition: calendarBuilder.cpp:104
BuildCalendar & endOfMonth()
End of month.
Definition: calendarBuilder.cpp:87
Definition: cadHoliday.cpp:3
BuildCalendar & withSpotLag(const int spot_lag)
Set spot lag.
Definition: calendarBuilder.cpp:36
Class implements calendar object.
Definition: calendar.hpp:30
bool end_of_month_
end of month convention
Definition: calendarBuilder.hpp:56
std::vector< Date > holidays_vector_
holidays as dates
Definition: calendarBuilder.hpp:64
Template of deep-coping smart pointer.
Definition: smartPointer.hpp:14
File contains definition of date class.
int spot_lag_
spot lag
Definition: calendarBuilder.hpp:52
BuildCalendar & addHoliday(const Date &holiday)
Marking day as holiday.
Definition: calendarBuilder.cpp:46
NameOfMonth
Definition: timeUnit.hpp:98
SmartPointer< SettlementDateConvention > settlement_
settlement date convention
Definition: calendarBuilder.hpp:72
File contains the definition of calendar class.
BuildCalendar()
Constructor.
Definition: calendarBuilder.cpp:13
Class implements a date object.
Definition: date.hpp:27
File contains definition of tenor class.
Class implements builder design pattern supporting construction of calendars.
Definition: calendarBuilder.hpp:32
std::vector< SmartPointer< Holiday > > holidays_
predefined holidays
Definition: calendarBuilder.hpp:68
BuildCalendar & removeHoliday(const Date &business_day)
Marking day as business day.
Definition: calendarBuilder.cpp:56
DayRollingConvention
Definition: timeUnit.hpp:117
File contain time units and other useful enumerations.
File contains definition of fixed holiday class.
DayRollingConvention convention_
day rolling
Definition: calendarBuilder.hpp:48