Space‐efficient, value‐semantic repository of weekend and holiday information.
Synopsis
Declared in <bdlt_packedcalendar.h>
class PackedCalendar;
Description
This class implements a space‐efficient, value‐semantic repository of weekend and holiday information over a valid range of dates. This valid range, [firstDate() .. lastDate()], spans the first and last dates of a calendar's accessible contents. A calendar can be "populated" with weekend and holiday information via a suite of "add" methods. Any subset of days of the week may be specified as weekend (i.e., recurring non‐business) days starting from a specified date by adding a weekend‐days transition; holidays within the valid range are specified individually. When adding a holiday, an arbitrary integer "holiday code" may be associated with that date. Additional holiday codes for that date may subsequently be added. Both the holidays and the set of unique holiday codes associated with each holiday date are maintained (internally) in order of increasing value. Note that the behavior of requesting any calendar information for a supplied date whose value is outside the current valid range for that calendar (unless otherwise noted, e.g., isWeekendDay) is undefined.
Type Aliases
Name |
Description |
Constant iterator over business days in this calendar. |
|
Constant reverse iterator over business days in this calendar. |
|
Constant iterator over holiday codes in this calendar. |
|
Constant reverse iterator over holiday codes in this calendar. |
|
Constant iterator over holidays in this calendar. |
|
Constant reverse iterator over holidays in this calendar. |
|
Transition describing a change in weekend days. |
|
Constant iterator over weekend‐days transitions in this calendar. |
|
Constant reverse iterator over weekend‐days transitions in this calendar. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Assign to this calendar the value of the specified |
|
Extend the valid range (if necessary) of this calendar to include the specified |
|
Mark the specified |
|
Mark |
|
Mark |
|
Mark |
|
Add |
|
Add |
|
Add a weekend‐days transition on |
|
Return the allocator used by this object to supply memory. |
|
Assign to this object the value read from the specified input stream. |
|
Write this value to the specified output |
|
|
|
|
|
|
|
Return an iterator to the first weekend‐days transition. |
|
|
|
|
|
|
|
Return a past‐the‐end iterator for weekend‐days transitions. |
|
Return the earliest date in the valid range of this calendar. |
|
|
|
Return the holiday at the specified |
|
Return the holiday code at |
|
Merge |
|
Merge |
|
Return |
|
Return |
|
Return |
|
Return |
|
|
|
Return the latest date in the valid range of this calendar. |
|
Return the number of days in the valid range of this calendar, which is defined to be 0 if this calendar is empty, and |
|
|
|
Return the number of holiday codes associated with |
|
Return the total number of holiday codes in this calendar. |
|
Return the number of holiday dates in this calendar. |
|
Return the number of non‐business days in this calendar. |
|
Return the number of days in the valid range of this calendar that are considered weekend days, irrespective of any designated holidays. |
|
Return the number of weekend‐days transitions maintained by this calendar. |
|
Format this object to the specified output |
|
|
|
|
|
|
|
Return an iterator to the last weekend‐days transition. |
|
Remove all information from this calendar, leaving it empty. |
|
Remove the holiday at the specified |
|
Remove |
|
|
|
|
|
|
|
Return a reverse end iterator for weekend‐days transitions. |
|
Reserve enough space to store at least the specified |
|
Reserve capacity for at least the specified number of holiday codes. |
|
Set the valid range of this calendar to |
|
Efficiently exchange the value of this object with that of |
|
Merge |
|
Merge |
|
Return the weekend‐days transition at the specified |
Static Member Functions
Name |
Description |
|
Friends
Name |
Description |
Pass the specified |
|
Return |
|
Return |
|
|
Provide read‐only, sequential access in increasing (chronological) order to the business days in a |