BloombergLP::bdlt::PackedCalendar::holidayCode

Return the holiday code at index for the holiday on date.

Synopsis

Declared in <bdlt_packedcalendar.h>

int
holidayCode(
    Date const& date,
    int index) const;

Description

Return, for the holiday at the specified date in this calendar, the holiday code at the specified index. For all index values from 0 to numHolidayCodes(date) - 1 (inclusive), a unique holiday code is returned. The mapping of index to holiday code is invalidated when the set of holidays or holiday codes is modified by an invocation of addHoliday, addHolidayCode, addHolidayCodeIfInRange, addHolidayIfInRange, intersectBusinessDays, intersectNonBusinessDays, removeAll, removeHoliday, removeHolidayCode, setValidRange, unionBusinessDays, or unionNonBusinessDays. The behavior is undefined unless date is a holiday in this calendar and 0 <= index < numHolidayCodes(date). Note that this method facilitates testing and generally should not be used by clients; in particular, using this method to iterate over the holiday codes for date is less efficient than using a HolidayCodeConstIterator.

Return Value

the holiday code at index for the holiday on date

Parameters

NameDescription
dateholiday whose codes are queried
indexposition of the holiday code to retrieve