Name |
Description |
Calendar [constructor]
|
Constructors |
~Calendar [destructor]
|
Destroy this object. |
operator=
|
Assignment operators |
addDay
|
Extend the valid range (if necessary) of this calendar to include the specified date value. |
addHoliday
|
Mark the specified date as a holiday (i.e., a non‐business day) in this calendar. Extend the valid range of this calendar if necessary. If date is already marked as a holiday, this method has no effect. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. |
addHolidayCode
|
Mark the specified date as a holiday (i.e., a non‐business day) in this calendar and add the specified holidayCode (if not already present) to the ordered set of codes associated with date. Extend the valid range of this calendar if necessary. If holidayCode is already a code for date, this method has no effect. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. Note that this method may be called repeatedly with the same value for date to build up a set of holiday codes for that date. |
addHolidayCodeIfInRange
|
Mark the specified date as a holiday (i.e., a non‐business day) in this calendar and add the specified holidayCode (if not already present) to the set of codes associated with date, if date is within the valid range of this calendar. Return 0 if date is in range, and a non‐zero value otherwise. If holidayCode is already a code for date, or if date is not in the valid range, this method has no effect. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. Note that this method may, at the expense of verifying isInRange(date) for each invocation, be called repeatedly with the same value for date to build up a set of holiday codes for that date. |
addHolidayIfInRange
|
Mark the specified date as a holiday (i.e., a non‐business day) in this calendar if date is within the valid range. Return 0 if date is in range, and a non‐zero value otherwise. This method has no effect if date is already marked as a holiday or is not in the valid range. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. |
addWeekendDay
|
Add the specified weekendDay to the set of weekend days associated with the weekend‐days transition at January 1, 0001 maintained by this calendar. Create a transition at January 1, 0001 if one does not exist. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. The behavior is undefined unless no weekend‐days transitions were added to this calendar via the addWeekendDaysTransition method. |
addWeekendDays
|
Add the specified weekendDays to the set of weekend days associated with the weekend‐days transition at January 1, 0001 maintained by this calendar. Create a transition at January 1, 0001 if one does not exist. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. The behavior is undefined unless no weekend‐days transitions were added to this calendar via the addWeekendDaysTransition method. |
addWeekendDaysTransition
|
Add to this calendar a weekend‐days transition on the specified startDate having the specified weekendDays set. If a weekend‐days transition already exists on startDate, replace the set of weekend days of that transition with weekendDays. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. Note that this method does not extend the valid range of the calendar. |
allocator
|
Return the allocator used by this object to supply memory. |
bdexStreamIn
|
Assign to this object the value read from the specified input stream using the specified version format and return a reference to the modifiable stream. If stream is initially invalid, this operation has no effect. If stream becomes invalid during this operation or if version is not supported, this object is unaltered. Note that no version is read from stream. See the bslx package‐level documentation for more information on BDEX streaming of value‐semantic types and containers. |
bdexStreamOut
|
Write this value to the specified output stream using the specified version format and return a reference to the modifiable stream. If version is not supported, stream is unmodified. Note that version is not written to stream. See the bslx package‐level documentation for more information on BDEX streaming of value‐semantic types and containers. |
beginBusinessDays
|
beginBusinessDays overloads
|
beginHolidayCodes
|
beginHolidayCodes overloads
|
beginHolidays
|
beginHolidays overloads
|
beginWeekendDaysTransitions
|
Return an iterator providing non‐modifiable access to the first weekend‐days transition in the chronological sequence of weekend‐days transitions maintained by this calendar. If this calendar has no weekend‐days transitions, the returned iterator has the same value as that returned by endWeekendDaysTransitions(). |
endBusinessDays
|
endBusinessDays overloads
|
endHolidayCodes
|
endHolidayCodes overloads
|
endHolidays
|
endHolidays overloads
|
endWeekendDaysTransitions
|
Return an iterator providing non‐modifiable access to the past‐the‐end weekend‐days transition in the chronological sequence of weekend‐days transitions maintained by this calendar. |
firstDate
|
Return a reference providing non‐modifiable access to the earliest date in the valid range of this calendar. The behavior is undefined unless this calendar is non‐empty ‐‐ i.e., unless 1 <= length(). |
getNextBusinessDay
|
getNextBusinessDay overloads
|
holiday
|
Return the holiday at the specified index in this calendar. For all index values from 0 to numHolidays() ‐ 1 (inclusive), a unique holiday is returned. The mapping of index to holiday is invalidated when the set of holidays is modified by an invocation of addHoliday, addHolidayIfInRange, intersectBusinessDays, intersectNonBusinessDays, removeAll, removeHoliday, setValidRange, unionBusinessDays, or unionNonBusinessDays. The behavior is undefined unless 0 <= index < numHolidays(). |
holidayCode
|
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. |
intersectBusinessDays
|
intersectBusinessDays overloads
|
intersectNonBusinessDays
|
intersectNonBusinessDays overloads
|
isBusinessDay
|
Return true if the specified date is a business day (i.e., not a holiday or weekend day) in this calendar, and false otherwise. The behavior is undefined unless date is within the valid range of this calendar. |
isHoliday
|
Return true if the specified date is a holiday in this calendar, and false otherwise. The behavior is undefined unless date is within the valid range of this calendar. |
isInRange
|
Return true if the specified date is within the valid range of this calendar (i.e., firstDate() <= date <= lastDate()), and false otherwise. Note that the valid range for a Calendar is empty if its length is 0. |
isNonBusinessDay
|
Return true if the specified date is not a business day (i.e., is either a holiday or weekend day) in this calendar, and false otherwise. The behavior is undefined unless date is within the valid range of this calendar. Note that: ` !isBusinessDay(date) ` returns the same result. |
isWeekendDay
|
isWeekendDay overloads
|
lastDate
|
Return a reference providing non‐modifiable access to the latest date in the valid range of this calendar. The behavior is undefined unless this calendar is non‐empty ‐‐ i.e., unless 1 <= length(). |
length
|
Return the number of days in the valid range of this calendar, which is defined to be 0 if this calendar is empty, and lastDate() ‐ firstDate() + 1 otherwise. |
numBusinessDays
|
numBusinessDays overloads
|
numHolidayCodes
|
Return the number of (unique) holiday codes associated with the specified date in this calendar if date is a holiday in this calendar, and 0 otherwise. The behavior is undefined unless date is within the valid range of this calendar. |
numHolidayCodesTotal
|
Return the total number of holiday codes for all holidays in this calendar. Note that this function is used primarily in conjunction with reserveHolidayCodeCapacity. |
numHolidays
|
Return the number of days in the valid range of this calendar that are individually marked as holidays, irrespective of whether or not the date is also considered a weekend day. |
numNonBusinessDays
|
Return the number of days in the valid range of this calendar that are not considered business days ‐‐ i.e., are either holidays, weekend days, or both. Note that numNonBusinessDays() == length() ‐ numBusinessDays(). |
numWeekendDaysInRange
|
Return the number of days in the valid range of this calendar that are considered weekend days, irrespective of any designated holidays. |
numWeekendDaysTransitions
|
Return the number of weekend‐days transitions maintained by this calendar. |
packedCalendar
|
Return a reference providing non‐modifiable access to the underlying PackedCalendar, which represents the same (mathematical) value as this calendar. |
print
|
Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. |
rbeginBusinessDays
|
rbeginBusinessDays overloads
|
rbeginHolidayCodes
|
rbeginHolidayCodes overloads
|
rbeginHolidays
|
rbeginHolidays overloads
|
rbeginWeekendDaysTransitions
|
Return an iterator providing non‐modifiable access to the last weekend‐days transition in the chronological sequence of weekend‐days transitions maintained by this calendar. If this calendar has no weekend‐days transitions, the returned iterator has the same value as that returned by rendWeekendDaysTransitions(). |
removeAll
|
Remove all information from this calendar, leaving it with its default constructed "empty" value. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. |
removeHoliday
|
Remove from this calendar the holiday having the specified date if such a holiday exists. This operation has no effect if date is not a holiday in this calendar. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. Note that this method is defined for all date values, not just those that fall within the valid range, and may be invoked even on an empty calendar (i.e., having 0 == length()). |
removeHolidayCode
|
Remove from this calendar the specified holidayCode for the holiday having the specified date if such a holiday having holidayCode exists. This operation has no effect if date is not a holiday in this calendar, or if the holiday at date does not have holidayCode associated with it. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. Note that this method is defined for all date values, not just those that fall within the valid range, and may be invoked even on an empty calendar (i.e., having 0 == length()). |
rendBusinessDays
|
rendBusinessDays overloads
|
rendHolidayCodes
|
rendHolidayCodes overloads
|
rendHolidays
|
rendHolidays overloads
|
rendWeekendDaysTransitions
|
Return an iterator providing non‐modifiable access to the element one before the first weekend‐days transition in the chronological sequence of weekend‐days transitions maintained by this calendar. |
reserveHolidayCapacity
|
Reserve enough space to store at least the specified numHolidays within this calendar. This method has no effect if numHolidays <= numHolidays(). |
reserveHolidayCodeCapacity
|
Reserve enough space to store at least the specified numHolidayCodes within this calendar assuming no additional holidays are added to this calendar. This method has no effect if numHolidayCodes <= numHolidayCodesTotal(). |
setValidRange
|
Set the range of this calendar using the specified firstDate and lastDate as, respectively, the first date and the last date of the calendar. Any holiday that is outside the new range and its holiday codes are removed. See {Iterator Invalidation} for information regarding which iterators are affected by the use of this method. The behavior is undefined unless firstDate <= lastDate. |
swap
|
Efficiently exchange the value of this object with the value of the specified other object. This method provides the no‐throw exception‐safety guarantee. The behavior is undefined unless this object was created with the same allocator as other. |
unionBusinessDays
|
unionBusinessDays overloads
|
unionNonBusinessDays
|
unionNonBusinessDays overloads
|
weekendDaysTransition
|
Return the weekend‐days transition at the specified index in this calendar. For all index values from 0 to numWeekendDaysTransitions() ‐ 1 (inclusive), a unique weekend‐days transition is returned. The mapping of index to weekend‐days transition is invalidated when the set of weekend‐days transitions is modified by an invocation of addWeekendDay, addWeekendDays, addWeekendDaysTransition, intersectBusinessDays, intersectNonBusinessDays, removeAll, unionBusinessDays, or unionNonBusinessDays. The behavior is undefined unless 0 <= index < numWeekendDaysTransitions(). |