[#BloombergLP-bdlt-PackedCalendar_DateRef]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::PackedCalendar&lowbar;DateRef
:relfileprefix: ../../
:mrdocs:

This private class is used by the arrow operator of the holiday iterator and business day iterator classes&period; The objects instantiated from this class serve as references to `Date` objects&period;

== Synopsis

Declared in `&lt;bdlt&lowbar;packedcalendar&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class PackedCalendar&lowbar;DateRef
    : public xref:BloombergLP/bdlt/Date.adoc[Date]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlt/Date.adoc[Date]`
| This class implements a complex&hyphen;constrained, value&hyphen;semantic type for representing dates according to the Unix (POSIX) calendar&period; Each object of this class _always_ represents a _valid_ date value in the range `&lsqb;0001JAN01 &period;&period; 9999DEC31&rsqb;` inclusive&period; The interface of this class supports `Date` values expressed in terms of either year&sol;month&sol;day (the canonical representation) or year&sol;day&hyphen;of&hyphen;year (an alternate representation)&period; See &lsqb;&rsqb;Date Values and Their Representations) for details&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/PackedCalendar_DateRef/2constructor-0b8.adoc[`PackedCalendar&lowbar;DateRef`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlt/PackedCalendar_DateRef/2destructor.adoc[`&#126;PackedCalendar&lowbar;DateRef`] [.small]#[destructor]#
| Destroy this object&period;
| xref:BloombergLP/bdlt/Date/operator_assign.adoc[`operator&equals;`] 
| Assign to this object the value of the specified `rhs` date, and return a reference providing modifiable access to this object&period;
| xref:BloombergLP/bdlt/Date/addDaysIfValid.adoc[`addDaysIfValid`] 
| Set this object to have the value that is later by the specified (signed) `numDays` from its current value, if the resulting value falls within the range of dates supported by this class (see `isValidYearMonthDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period; Note that `numDays` may be negative&period;
| xref:BloombergLP/bdlt/Date/bdexStreamIn.adoc[`bdexStreamIn`] 
| Assign to this object the value read from the specified input `stream` using the specified `version` format, and return a reference to `stream`&period; If `stream` is initially invalid, this operation has no effect&period; If `version` is not supported, this object is unaltered and `stream` is invalidated, but otherwise unmodified&period; If `version` is supported but `stream` becomes invalid during this operation, this object has an undefined, but valid, state&period; Note that no version is read from `stream`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
| xref:BloombergLP/bdlt/Date/bdexStreamOut.adoc[`bdexStreamOut`] 
| Write the value of this object, using the specified `version` format, to the specified output `stream`, and return a reference to `stream`&period; If `stream` is initially invalid, this operation has no effect&period; If `version` is not supported, `stream` is invalidated, but otherwise unmodified&period; Note that `version` is not written to `stream`&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;
| xref:BloombergLP/bdlt/Date/day.adoc[`day`] 
| Return the day of the month in the range `&lsqb;1 &period;&period; 31&rsqb;` of this date&period;
| xref:BloombergLP/bdlt/Date/dayOfWeek.adoc[`dayOfWeek`] 
| Return the day of the week in the range `&lsqb;DayOfWeek&colon;&colon;e&lowbar;SUN &period;&period; DayOfWeek&colon;&colon;e&lowbar;SAT&rsqb;` of this date&period;
| xref:BloombergLP/bdlt/Date/dayOfYear.adoc[`dayOfYear`] 
| Return the day of the year in the range `&lsqb;1 &period;&period; 366&rsqb;` of this date&period;
| xref:BloombergLP/bdlt/Date/getYearDay.adoc[`getYearDay`] 
| Load, into the specified `year` and `dayOfYear`, the respective `year` and `dayOfYear` attribute values of this date&period;
| xref:BloombergLP/bdlt/Date/getYearMonthDay.adoc[`getYearMonthDay`] 
| Load, into the specified `year`, `month`, and `day`, the respective `year`, `month`, and `day` attribute values of this date&period;
| xref:BloombergLP/bdlt/Date/month.adoc[`month`] 
| Return the month of the year in the range `&lsqb;1 &period;&period; 12&rsqb;` of this date&period;
| xref:BloombergLP/bdlt/Date/monthOfYear.adoc[`monthOfYear`] 
| Return the month of the year in the range `&lsqb;MonthOfYear&colon;&colon;e&lowbar;JAN &period;&period; MonthOfYear&colon;&colon;e&lowbar;DEC&rsqb;` of this date&period;
| xref:BloombergLP/bdlt/PackedCalendar_DateRef/operator_bitand.adoc[`operator&amp;`] 
| Return a proxy object to this object&apos;s referenced date&period;
| xref:BloombergLP/bdlt/Date/operator_inc.adoc[`operator&plus;&plus;`] 
| Set this object to have the value that is one day later than its current value, and return a reference providing modifiable access to this object&period; The behavior is undefined if the year&sol;month&sol;day representation of the current value is `9999&sol;12&sol;31`&period;
| xref:BloombergLP/bdlt/Date/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Assign to this object the value that is later by the specified (signed) `numDays` from its current value, and return a reference providing modifiable access to this object&period; The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see `isValidYearMonthDay`)&period; Note that `numDays` may be negative&period;
| xref:BloombergLP/bdlt/Date/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Set this object to have the value that is one day earlier than its current value, and return a reference providing modifiable access to this object&period; The behavior is undefined if the year&sol;month&sol;day representation of the current value is `0001&sol;01&sol;01`&period;
| xref:BloombergLP/bdlt/Date/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Assign to this object the value that is earlier by the specified (signed) `numDays` from its current value, and return a reference providing modifiable access to this object&period; The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see `isValidYearMonthDay`)&period; Note that `numDays` may be negative&period;
| xref:BloombergLP/bdlt/Date/print.adoc[`print`] 
| Write the value of this object to the specified output `stream` in a human&hyphen;readable format, and return a reference to `stream`&period; Optionally specify an initial indentation `level`, whose absolute value is incremented recursively for nested objects&period; If `level` is specified, optionally specify `spacesPerLevel`, whose absolute value indicates the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period; Note that this human&hyphen;readable format is not fully specified, and can change without notice&period;
| xref:BloombergLP/bdlt/Date/setYearDay.adoc[`setYearDay`] 
| Set this object to have the value represented by the specified `year` and `dayOfYear`&period; The behavior is undefined unless `year` and `dayOfYear` represent a valid `Date` value (see `isValidYearDay`)&period;
| xref:BloombergLP/bdlt/Date/setYearDayIfValid.adoc[`setYearDayIfValid`] 
| Set this object to have the value represented by the specified `year` and `dayOfYear` if they comprise a valid `Date` value (see `isValidYearDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Date/setYearMonthDay.adoc[`setYearMonthDay`] 
| Set this object to have the value represented by the specified `year`, `month`, and `day`&period; The behavior is undefined unless `year`, `month`, and `day` represent a valid `Date` value (see `isValidYearMonthDay`)&period;
| xref:BloombergLP/bdlt/Date/setYearMonthDayIfValid.adoc[`setYearMonthDayIfValid`] 
| Set this object to have the value represented by the specified `year`, `month`, and `day` if they comprise a valid `Date` value (see `isValidYearMonthDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Date/streamOut.adoc[`streamOut`] 
| Write the value of this object to the specified output `stream` in a single&hyphen;line format, and return a reference to `stream`&period; If `stream` is not valid on entry, this operation has no effect&period; Note that this human&hyphen;readable format is not fully specified, can change without notice, and is logically equivalent to&colon; &grave; print(stream, 0, &hyphen;1)&semi; &grave;
| xref:BloombergLP/bdlt/Date/validateAndSetYearDay.adoc[`validateAndSetYearDay`] 
| Set this object to have the value represented by the specified `year` and `dayOfYear` if they comprise a valid `Date` value (see `isValidYearDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Date/validateAndSetYearMonthDay.adoc[`validateAndSetYearMonthDay`] 
| Set this object to have the value represented by the specified `year`, `month`, and `day` if they comprise a valid `Date` value (see `isValidYearMonthDay`)&period; Return 0 on success, and a non&hyphen;zero value (with no effect) otherwise&period;
| xref:BloombergLP/bdlt/Date/year.adoc[`year`] 
| Return the year in the range `&lsqb;1 &period;&period; 9999&rsqb;` of this date&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/Date/isValid-09.adoc[`isValid`] 
| `isValid` overloads
| xref:BloombergLP/bdlt/Date/isValidYearDay.adoc[`isValidYearDay`] 
| Return `true` if the specified `year` and `dayOfYear` represent a valid value for a `Date` object, and `false` otherwise&period; `year` and `dayOfYear` represent a valid `Date` value if they correspond to a valid date as defined by the Unix (POSIX) calendar confined to the year range `&lsqb;1 &period;&period; 9999&rsqb;` inclusive&period; See &lcub;Valid Date Values and Their Representations&rcub; for details&period;
| xref:BloombergLP/bdlt/Date/isValidYearMonthDay.adoc[`isValidYearMonthDay`] 
| Return `true` if the specified `year`, `month`, and `day` represent a valid value for a `Date` object, and `false` otherwise&period; `year`, `month`, and `day` represent a valid `Date` value if they correspond to a valid date as defined by the Unix (POSIX) calendar confined to the year range `&lsqb;1 &period;&period; 9999&rsqb;` inclusive&period; See &lcub;Valid Date Values and Their Representations&rcub; for details&period;
| xref:BloombergLP/bdlt/Date/maxSupportedBdexVersion-06.adoc[`maxSupportedBdexVersion`] 
| `maxSupportedBdexVersion` overloads
| xref:BloombergLP/bdlt/Date/maxSupportedVersion.adoc[`maxSupportedVersion`] 
| Return the most current BDEX streaming version number supported by this class&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlt/operator_not_eq-0cd.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise&period; Two `Date` objects do not have the same value if any of their `year`, `month`, and `day` attributes (respectively) do not have the same value&period;
| xref:BloombergLP/bdlt/operator_plus-04.adoc[`operator&plus;`]
| Return the date value that is later by the specified (signed) `numDays` from the specified `date`&period; The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see `isValidYearMonthDay`)&period; Note that `numDays` may be negative&period;
| xref:BloombergLP/bdlt/operator_inc-0f.adoc[`operator&plus;&plus;`]
| Set the specified `date` object to have the value that is one day later than its current value, and return the value of `date` on entry&period; The behavior is undefined if the value of `date` on entry is `9999&sol;12&sol;31`&period;
| xref:BloombergLP/bdlt/operator_minus-00f.adoc[`operator&hyphen;`]
| Return the (signed) number of days between the specified `lhs` and `rhs` dates&period; Note that if `lhs &lt; rhs` the result will be negative&period;
| xref:BloombergLP/bdlt/operator_minus-09c.adoc[`operator&hyphen;`]
| Return the date value that is earlier by the specified (signed) `numDays` from the specified `date`&period; The behavior is undefined unless the resulting value falls within the range of dates supported by this class (see `isValidYearMonthDay`)&period; Note that `numDays` may be negative&period;
| xref:BloombergLP/bdlt/operator_dec-01.adoc[`operator&hyphen;&hyphen;`]
| Set the specified `date` object to have the value that is one day earlier than its current value, and return the value of `date` on entry&period; The behavior is undefined if the value of `date` on entry is `0001&sol;01&sol;01`&period;
| xref:BloombergLP/bdlt/operator_lt-01.adoc[`operator&lt;`]
| Return `true` if the specified `lhs` date is earlier than the specified `rhs` date, and `false` otherwise&period;
| xref:BloombergLP/bdlt/operator_le-04.adoc[`operator&lt;&equals;`]
| Return `true` if the specified `lhs` date is earlier than or the same as the specified `rhs` date, and `false` otherwise&period;
| xref:BloombergLP/bdlt/operator_eq-057.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `Date` objects have the same value if each of their `year`, `month`, and `day` attributes (respectively) have the same value&period;
| xref:BloombergLP/bdlt/operator_gt-0c.adoc[`operator&gt;`]
| Return `true` if the specified `lhs` date is later than the specified `rhs` date, and `false` otherwise&period;
| xref:BloombergLP/bdlt/operator_ge-079.adoc[`operator&gt;&equals;`]
| Return `true` if the specified `lhs` date is later than or the same as the specified `rhs` date, and `false` otherwise&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
