8#ifndef INCLUDED_BDLT_PACKEDCALENDAR
9#define INCLUDED_BDLT_PACKEDCALENDAR
528#include <bdlscm_version.h>
551#include <bsl_cstddef.h>
552#include <bsl_iosfwd.h>
553#include <bsl_iterator.h>
554#include <bsl_utility.h>
555#include <bsl_vector.h>
557#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
560#include <bsl_algorithm.h>
566class PackedCalendar_BusinessDayConstIterator;
567class PackedCalendar_HolidayCodeConstIterator;
568class PackedCalendar_HolidayConstIterator;
608 struct WeekendDaysTransitionLess {
648 bsl::reverse_iterator<WeekendDaysTransitionSequence::const_iterator>
662 d_weekendDaysTransitions;
698 template <
class HASHALG>
710 static void intersectHolidays(
740 int addHolidayImp(
int offset);
991 template <
class STREAM>
1361 template <
class STREAM>
1374 bsl::ostream&
print(bsl::ostream& stream,
1376 int spacesPerLevel = 4)
const;
1378#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1418template <
class HASHALG>
1533 const Date firstDate);
1544#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1663#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1760 int d_currentOffset;
1792 const Date& startDate,
1799 void nextBusinessDay();
1803 void previousBusinessDay();
1814#ifndef BDE_OMIT_INTERNAL_DEPRECATED
1914: d_date(original.d_date)
1961PackedCalendar_HolidayConstIterator::
1962 PackedCalendar_HolidayConstIterator(
const OffsetsConstIterator& iter,
1963 const Date firstDate)
1965, d_firstDate(firstDate)
1971PackedCalendar_HolidayConstIterator::PackedCalendar_HolidayConstIterator(
1973: d_iterator(original.d_iterator)
1974, d_firstDate(original.d_firstDate)
1988 d_iterator = rhs.d_iterator;
1989 d_firstDate = rhs.d_firstDate;
2028 const PackedCalendar_HolidayConstIterator& rhs)
2030 return lhs.d_iterator == rhs.d_iterator;
2035 const PackedCalendar_HolidayConstIterator& rhs)
2037 return lhs.d_iterator != rhs.d_iterator;
2044 PackedCalendar_HolidayConstIterator tmp(iterator);
2053 PackedCalendar_HolidayConstIterator tmp(iterator);
2066PackedCalendar_HolidayCodeConstIterator::
2067 PackedCalendar_HolidayCodeConstIterator(
const CodesConstIterator& iter)
2074PackedCalendar_HolidayCodeConstIterator::
2075PackedCalendar_HolidayCodeConstIterator(
2077: d_iterator(original.d_iterator)
2093 d_iterator = rhs.d_iterator;
2125 const PackedCalendar_HolidayCodeConstIterator& rhs)
2127 return lhs.d_iterator == rhs.d_iterator;
2132 const PackedCalendar_HolidayCodeConstIterator& rhs)
2134 return lhs.d_iterator != rhs.d_iterator;
2150 PackedCalendar_HolidayCodeConstIterator tmp(iterator);
2158 const PackedCalendar_HolidayCodeConstIterator& rhs)
2160 return lhs.d_iterator - rhs.d_iterator;
2171PackedCalendar_BusinessDayConstIterator::
2172PackedCalendar_BusinessDayConstIterator(
2174: d_offsetIter(original.d_offsetIter)
2175, d_calendar_p(original.d_calendar_p)
2176, d_currentOffset(original.d_currentOffset)
2177, d_endFlag(original.d_endFlag)
2204 previousBusinessDay();
2228 const PackedCalendar_BusinessDayConstIterator& rhs)
2232 return lhs.d_endFlag == rhs.d_endFlag
2233 && lhs.d_currentOffset == rhs.d_currentOffset;
2238 const PackedCalendar_BusinessDayConstIterator& rhs)
2242 return lhs.d_endFlag != rhs.d_endFlag
2243 || lhs.d_currentOffset != rhs.d_currentOffset;
2248 PackedCalendar_BusinessDayConstIterator& iterator,
int)
2250 PackedCalendar_BusinessDayConstIterator tmp(iterator);
2257 PackedCalendar_BusinessDayConstIterator& iterator,
int)
2259 PackedCalendar_BusinessDayConstIterator tmp(iterator);
2272PackedCalendar::CodesConstIterator
2273 PackedCalendar::beginHolidayCodes(
const OffsetsConstIterator& iter)
const
2277 const int indexOffset =
static_cast<int>(iter - d_holidayOffsets.
begin());
2279 const bsl::size_t codeOffset = d_holidayCodesIndex[indexOffset];
2281 return d_holidayCodes.
begin() + codeOffset;
2285PackedCalendar::CodesConstIterator
2286 PackedCalendar::endHolidayCodes(
const OffsetsConstIterator& iter)
const
2290 const bsl::size_t endIndexOffset = iter - d_holidayOffsets.
begin() + 1;
2292 const bsl::size_t iterIndex = endIndexOffset ==
2293 d_holidayCodesIndex.
length()
2294 ? d_holidayCodes.
length()
2295 : d_holidayCodesIndex[endIndexOffset];
2296 return d_holidayCodes.
begin() + iterIndex;
2306 if (versionSelector >= 20150612) {
2352template <
class STREAM>
2372 stream.invalidate();
2378 int transitionsLength = 0;
2379 stream.getLength(transitionsLength);
2381 if (!stream || transitionsLength < 0) {
2382 stream.invalidate();
2387 weekendDaysTransitions(transitionsLength, d_allocator_p);
2388 for (
int i = 0; i < transitionsLength; ++i) {
2391 wdt.
first.bdexStreamIn(stream, 1);
2399 if (i && wdt.
first <= weekendDaysTransitions[i - 1].first) {
2400 stream.invalidate();
2404 wdt.
second.bdexStreamIn(stream, 1);
2419 && (holidayOffsets[0] < 0
2420 || holidayOffsets[0] >
length))))) {
2421 stream.invalidate();
2428 for (bsl::size_t i = 1; i < holidayOffsets.
length(); ++i) {
2429 if (holidayOffsets[i - 1] >= holidayOffsets[i]
2430 || holidayOffsets[i] >
length) {
2431 stream.invalidate();
2440 || holidayCodesIndex.
length() != holidayOffsets.
length()
2441 || (!holidayCodesIndex.
isEmpty() && holidayCodesIndex[0] != 0)) {
2442 stream.invalidate();
2449 for (bsl::size_t i = 1; i < holidayCodesIndex.
length(); ++i) {
2450 if (holidayCodesIndex[i - 1] > holidayCodesIndex[i]) {
2451 stream.invalidate();
2461 stream.invalidate();
2468 bsl::size_t index = 0;
2469 for (
int i = 0; i < static_cast<int>(holidayCodes.
length()); ++i) {
2470 if (index < holidayCodesIndex.
length()
2471 && i == holidayCodesIndex[index]) {
2473 while (index < holidayCodesIndex.
length()
2474 && i == holidayCodesIndex[index]) {
2478 else if (holidayCodes[i - 1] >= holidayCodes[i]) {
2479 stream.invalidate();
2487 &weekendDaysTransitions);
2501 || (inCal.d_firstDate > inCal.d_lastDate
2502 && (inCal.d_firstDate !=
Date(9999,12,31)
2503 || inCal.d_lastDate !=
Date(1,1,1)))) {
2504 stream.invalidate();
2507 int length = inCal.d_lastDate - inCal.d_firstDate + 1;
2509 int transitionsLength = 0;
2510 stream.getLength(transitionsLength);
2511 if (!stream || transitionsLength < 0)
2513 stream.invalidate();
2517 int offsetsLength = 0;
2518 stream.getLength(offsetsLength);
2520 || (inCal.d_firstDate > inCal.d_lastDate
2521 && offsetsLength != 0)
2522 || (inCal.d_firstDate <= inCal.d_lastDate
2523 && (offsetsLength < 0 || offsetsLength >
length))) {
2524 stream.invalidate();
2529 int codesLength = 0;
2530 stream.getLength(codesLength);
2531 if (!stream || (0 == offsetsLength && codesLength != 0)) {
2532 stream.invalidate();
2536 inCal.d_weekendDaysTransitions.resize(transitionsLength);
2548 inCal.d_holidayOffsets.
resize(offsetsLength);
2549 inCal.d_holidayCodesIndex.
resize(offsetsLength);
2550 inCal.d_holidayCodes.
resize(codesLength);
2553 inCal.d_weekendDaysTransitions.begin();
2554 it != inCal.d_weekendDaysTransitions.end();
2556 it->first.bdexStreamIn(stream, 1);
2561 if (it != inCal.d_weekendDaysTransitions.begin()
2562 && it->first <= (it - 1)->first) {
2563 stream.invalidate();
2567 it->second.bdexStreamIn(stream, 1);
2573 int previousValue = -1;
2574 for (
int i = 0; i < offsetsLength; ++i) {
2576 stream.getInt32(tmp);
2580 || tmp <= previousValue) {
2581 stream.invalidate();
2584 inCal.d_holidayOffsets.
replace(i, tmp);
2585 previousValue = tmp;
2589 for (
int i = 0; i < offsetsLength; ++i) {
2591 stream.getInt32(tmp);
2598 || tmp < previousValue
2599 || tmp > codesLength
2600 || (0 == i && 0 != tmp)) {
2608 stream.invalidate();
2611 inCal.d_holidayCodesIndex.
replace(i, tmp);
2612 previousValue = tmp;
2620 while (it != end && 0 == *it) {
2627 bool previousValueFlag =
false;
2634 for (
int i = 0; i < codesLength; ++i) {
2636 stream.getInt32(tmp);
2638 || (previousValueFlag && tmp <= previousValue)) {
2639 stream.invalidate();
2642 inCal.d_holidayCodes.
replace(i, tmp);
2648 if (it != end && i == (*it - 1)) {
2649 previousValueFlag =
false;
2651 while (it != end && i == (*it - 1)) {
2656 previousValueFlag =
true;
2658 previousValue = tmp;
2673 || (inCal.d_firstDate > inCal.d_lastDate
2674 && (inCal.d_firstDate !=
Date(9999, 12, 31)
2675 || inCal.d_lastDate !=
Date(1, 1, 1)))) {
2676 stream.invalidate();
2679 int length = inCal.d_lastDate - inCal.d_firstDate + 1;
2687 if (weekendDays.
length() > 0) {
2691 int offsetsLength = 0;
2692 stream.getLength(offsetsLength);
2694 || (inCal.d_firstDate > inCal.d_lastDate
2695 && offsetsLength != 0)
2696 || (inCal.d_firstDate <= inCal.d_lastDate
2697 && (offsetsLength < 0 || offsetsLength >
length))) {
2698 stream.invalidate();
2703 int codesLength = 0;
2704 stream.getLength(codesLength);
2705 if (!stream || (0 == offsetsLength && codesLength != 0)) {
2706 stream.invalidate();
2720 inCal.d_holidayOffsets.
resize(offsetsLength);
2721 inCal.d_holidayCodesIndex.
resize(offsetsLength);
2722 inCal.d_holidayCodes.
resize(codesLength);
2724 int previousValue = -1;
2725 for (
int i = 0; i < offsetsLength; ++i) {
2727 stream.getInt32(tmp);
2731 || tmp <= previousValue) {
2732 stream.invalidate();
2735 inCal.d_holidayOffsets.
replace(i, tmp);
2736 previousValue = tmp;
2740 for (
int i = 0; i < offsetsLength; ++i) {
2742 stream.getInt32(tmp);
2749 || tmp < previousValue
2750 || tmp > codesLength
2751 || (0 == i && 0 != tmp)) {
2759 stream.invalidate();
2762 inCal.d_holidayCodesIndex.
replace(i, tmp);
2763 previousValue = tmp;
2771 while (it != end && 0 == *it) {
2778 bool previousValueFlag =
false;
2785 for (
int i = 0; i < codesLength; ++i) {
2787 stream.getInt32(tmp);
2789 || (previousValueFlag && tmp <= previousValue)) {
2790 stream.invalidate();
2793 inCal.d_holidayCodes.
replace(i, tmp);
2799 if (it != end && i == (*it - 1)) {
2800 previousValueFlag =
false;
2802 while (it != end && i == (*it - 1)) {
2807 previousValueFlag =
true;
2809 previousValue = tmp;
2816 stream.invalidate();
2862 d_holidayOffsets.
begin(),
2863 d_holidayOffsets.
end(),
2864 date - d_firstDate);
2872 return d_weekendDaysTransitions.begin();
2897 return endHolidayCodes(iter.d_iterator);
2913 d_holidayOffsets.
begin(),
2914 d_holidayOffsets.
end(),
2915 date - d_firstDate);
2923 return d_weekendDaysTransitions.end();
2936 const Date& date)
const
2942 enum { e_SUCCESS = 0, e_FAILURE = 1 };
2948 *nextBusinessDay = *iter;
2958 return d_firstDate + d_holidayOffsets[index];
2969 const int offset = date - d_firstDate;
2976 return d_holidayCodes[d_holidayCodesIndex[i - offsetBegin] + index];
2992 const int offset = date - d_firstDate;
2995 d_holidayOffsets.
begin(),
2999 return i != offsetEnd && *i == offset;
3005 return d_firstDate <= date && date <= d_lastDate;
3023 if (d_weekendDaysTransitions.empty()) {
3029 return d_weekendDaysTransitions[0].second.isMember(dayOfWeek);
3043 return d_firstDate <= d_lastDate ? d_lastDate - d_firstDate + 1 : 0;
3055 return static_cast<int>(d_holidayCodes.
length());
3061 return static_cast<int>(d_holidayOffsets.
length());
3067 return static_cast<int>(d_weekendDaysTransitions.size());
3125 d_weekendDaysTransitions.end());
3183 d_weekendDaysTransitions.begin());
3193 return d_weekendDaysTransitions[index];
3201 return d_allocator_p;
3204template <
class STREAM>
3212 stream.putLength(
static_cast<int>(d_weekendDaysTransitions.size()));
3214 i < d_weekendDaysTransitions.size();
3216 d_weekendDaysTransitions[i].first.bdexStreamOut(stream, 1);
3217 d_weekendDaysTransitions[i].second.bdexStreamOut(stream, 1);
3228 stream.putLength(
static_cast<int>(d_weekendDaysTransitions.size()));
3229 stream.putLength(
static_cast<int>(d_holidayOffsets.
length()));
3230 stream.putLength(
static_cast<int>(d_holidayCodes.
length()));
3233 i < d_weekendDaysTransitions.size();
3235 d_weekendDaysTransitions[i].first.bdexStreamOut(stream, 1);
3236 d_weekendDaysTransitions[i].second.bdexStreamOut(stream, 1);
3239 for (bsl::size_t i = 0; i < d_holidayOffsets.
length(); ++i) {
3240 stream.putInt32(d_holidayOffsets[i]);
3242 for (bsl::size_t i = 0; i < d_holidayCodesIndex.
length(); ++i) {
3243 stream.putInt32(d_holidayCodesIndex[i]);
3245 for (bsl::size_t i = 0; i < d_holidayCodes.
length(); ++i) {
3246 stream.putInt32(d_holidayCodes[i]);
3253 if (!d_weekendDaysTransitions.empty() &&
3254 d_weekendDaysTransitions[0].first ==
Date(1, 1, 1)) {
3255 d_weekendDaysTransitions[0].second.bdexStreamOut(stream, 1);
3262 stream.putLength(
static_cast<int>(d_holidayOffsets.
length()));
3263 stream.putLength(
static_cast<int>(d_holidayCodes.
length()));
3265 for (bsl::size_t i = 0; i < d_holidayOffsets.
length(); ++i) {
3266 stream.putInt32(d_holidayOffsets[i]);
3268 for (bsl::size_t i = 0; i < d_holidayCodesIndex.
length(); ++i) {
3269 stream.putInt32(d_holidayCodesIndex[i]);
3271 for (bsl::size_t i = 0; i < d_holidayCodes.
length(); ++i) {
3272 stream.putInt32(d_holidayCodes[i]);
3276 stream.invalidate();
3283#ifndef BDE_OMIT_INTERNAL_DEPRECATED
3300 return !(lhs == rhs);
3304template <
class HASHALG>
3308 using ::BloombergLP::bslh::hashAppend;
3311 hashAppend(hashAlg,
object.d_weekendDaysTransitions);
3312 hashAppend(hashAlg,
object.d_holidayOffsets);
3313 hashAppend(hashAlg,
object.d_holidayCodesIndex);
Definition bdlc_packedintarray.h:770
Definition bdlc_packedintarray.h:1048
const_iterator end() const
Definition bdlc_packedintarray.h:2556
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlc_packedintarray.h:2527
const_iterator begin() const
Definition bdlc_packedintarray.h:2535
bool isEmpty() const
Definition bdlc_packedintarray.h:2572
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlc_packedintarray.h:2316
void resize(bsl::size_t numElements)
Definition bdlc_packedintarray.h:2484
bsl::size_t length() const
Return number of elements in this array.
Definition bdlc_packedintarray.h:2586
void reserveCapacity(bsl::size_t numElements)
Definition bdlc_packedintarray.h:2451
void replace(bsl::size_t dstIndex, TYPE value)
Definition bdlc_packedintarray.h:2423
Definition bdlt_calendarreverseiteratoradapter.h:298
Definition bdlt_date.h:294
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlt_date.h:985
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlt_date.h:896
Definition bdlt_dayofweekset.h:398
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlt_dayofweekset.h:813
int length() const
Return the number of elements in this set.
Definition bdlt_dayofweekset.h:869
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlt_dayofweekset.h:889
Definition bdlt_packedcalendar.h:1751
PackedCalendar_DateProxy operator->() const
Definition bdlt_packedcalendar.h:2218
PackedCalendar_BusinessDayConstIterator & operator++()
Definition bdlt_packedcalendar.h:2190
int difference_type
Definition bdlt_packedcalendar.h:1808
PackedCalendar_DateProxy pointer
Definition bdlt_packedcalendar.h:1809
Date value_type
Definition bdlt_packedcalendar.h:1807
PackedCalendar_DateRef reference
The star operator returns a PackedCalendar_DateRef by value.
Definition bdlt_packedcalendar.h:1812
friend bool operator!=(const PackedCalendar_BusinessDayConstIterator &, const PackedCalendar_BusinessDayConstIterator &)
PackedCalendar_BusinessDayConstIterator & operator=(const PackedCalendar_BusinessDayConstIterator &rhs)
bsl::bidirectional_iterator_tag iterator_category
Definition bdlt_packedcalendar.h:1816
friend bool operator==(const PackedCalendar_BusinessDayConstIterator &, const PackedCalendar_BusinessDayConstIterator &)
PackedCalendar_BusinessDayConstIterator & operator--()
Definition bdlt_packedcalendar.h:2200
PackedCalendar_DateRef operator*() const
Definition bdlt_packedcalendar.h:2211
~PackedCalendar_BusinessDayConstIterator()
Destroy this object.
Definition bdlt_packedcalendar.h:2183
Definition bdlt_packedcalendar.h:1436
PackedCalendar_DateProxy(const Date &date)
Create a proxy object for the specified date.
Definition bdlt_packedcalendar.h:1901
~PackedCalendar_DateProxy()
Destroy this object.
Definition bdlt_packedcalendar.h:1907
const Date * operator->() const
Definition bdlt_packedcalendar.h:1920
Definition bdlt_packedcalendar.h:1474
~PackedCalendar_DateRef()
Destroy this object.
Definition bdlt_packedcalendar.h:1944
PackedCalendar_DateProxy operator&() const
Return a proxy object to this object's referenced date.
Definition bdlt_packedcalendar.h:1950
PackedCalendar_DateRef(const Date &date)
Create a date reference object using the specified date.
Definition bdlt_packedcalendar.h:1931
Definition bdlt_packedcalendar.h:1628
friend bool operator!=(const PackedCalendar_HolidayCodeConstIterator &, const PackedCalendar_HolidayCodeConstIterator &)
friend bsl::ptrdiff_t operator-(const PackedCalendar_HolidayCodeConstIterator &, const PackedCalendar_HolidayCodeConstIterator &)
PackedCalendar_HolidayCodeConstIterator & operator=(const PackedCalendar_HolidayCodeConstIterator &rhs)
Definition bdlt_packedcalendar.h:2091
PackedCalendar_HolidayCodeConstIterator & operator--()
Definition bdlt_packedcalendar.h:2107
int value_type
Definition bdlt_packedcalendar.h:1656
int reference
The star operator returns an int by value.
Definition bdlt_packedcalendar.h:1661
~PackedCalendar_HolidayCodeConstIterator()
Destroy this object.
Definition bdlt_packedcalendar.h:2083
int operator*() const
Return the holiday code referenced by this iterator.
Definition bdlt_packedcalendar.h:2115
bsl::bidirectional_iterator_tag iterator_category
Definition bdlt_packedcalendar.h:1665
int difference_type
Definition bdlt_packedcalendar.h:1657
friend bool operator==(const PackedCalendar_HolidayCodeConstIterator &, const PackedCalendar_HolidayCodeConstIterator &)
int * pointer
Definition bdlt_packedcalendar.h:1658
PackedCalendar_HolidayCodeConstIterator & operator++()
Definition bdlt_packedcalendar.h:2099
Definition bdlt_packedcalendar.h:1510
PackedCalendar_HolidayConstIterator & operator--()
Definition bdlt_packedcalendar.h:2003
PackedCalendar_DateProxy pointer
Definition bdlt_packedcalendar.h:1539
PackedCalendar_HolidayConstIterator & operator++()
Definition bdlt_packedcalendar.h:1995
~PackedCalendar_HolidayConstIterator()
Destroy this object.
Definition bdlt_packedcalendar.h:1979
bsl::bidirectional_iterator_tag iterator_category
Definition bdlt_packedcalendar.h:1546
int difference_type
Definition bdlt_packedcalendar.h:1538
PackedCalendar_HolidayConstIterator & operator=(const PackedCalendar_HolidayConstIterator &rhs)
Definition bdlt_packedcalendar.h:1986
friend bool operator==(const PackedCalendar_HolidayConstIterator &, const PackedCalendar_HolidayConstIterator &)
Date value_type
Definition bdlt_packedcalendar.h:1537
PackedCalendar_DateRef operator*() const
Definition bdlt_packedcalendar.h:2011
friend bool operator!=(const PackedCalendar_HolidayConstIterator &, const PackedCalendar_HolidayConstIterator &)
PackedCalendar_DateRef reference
The star operator returns a PackedCalendar_DateRef by value.
Definition bdlt_packedcalendar.h:1542
PackedCalendar_DateProxy operator->() const
Return a date proxy for the holiday referenced by this iterator.
Definition bdlt_packedcalendar.h:2018
Definition bdlt_packedcalendar.h:592
void reserveHolidayCodeCapacity(int numHolidayCodes)
Definition bdlt_packedcalendar.h:2343
HolidayConstReverseIterator rbeginHolidays() const
Definition bdlt_packedcalendar.h:3106
int getNextBusinessDay(Date *nextBusinessDay, const Date &date) const
Definition bdlt_packedcalendar.h:2935
void addWeekendDays(const DayOfWeekSet &weekendDays)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bool isBusinessDay(const Date &date) const
Definition bdlt_packedcalendar.h:2980
bdlt::CalendarReverseIteratorAdapter< HolidayConstIterator > HolidayConstReverseIterator
Definition bdlt_packedcalendar.h:639
PackedCalendar(bslma::Allocator *basicAllocator=0)
void addHoliday(const Date &date)
PackedCalendar_HolidayConstIterator HolidayConstIterator
Definition bdlt_packedcalendar.h:631
void unionBusinessDays(const PackedCalendar &other)
int numWeekendDaysInRange() const
PackedCalendar(const Date &firstDate, const Date &lastDate, bslma::Allocator *basicAllocator=0)
int numNonBusinessDays() const
void setValidRange(const Date &firstDate, const Date &lastDate)
friend bool operator!=(const PackedCalendar &, const PackedCalendar &)
const Date & firstDate() const
Definition bdlt_packedcalendar.h:2927
int numBusinessDays(const Date &beginDate, const Date &endDate) const
void addHolidayCode(const Date &date, int holidayCode)
int numHolidays() const
Definition bdlt_packedcalendar.h:3059
int getNextBusinessDay(Date *nextBusinessDay, const Date &date, int nth) const
int numHolidayCodesTotal() const
Definition bdlt_packedcalendar.h:3053
void removeHoliday(const Date &date)
WeekendDaysTransitionConstReverseIterator rendWeekendDaysTransitions() const
Definition bdlt_packedcalendar.h:3180
HolidayCodeConstReverseIterator rendHolidayCodes(const Date &date) const
Definition bdlt_packedcalendar.h:3146
int holidayCode(const Date &date, int index) const
Definition bdlt_packedcalendar.h:2962
WeekendDaysTransitionConstIterator endWeekendDaysTransitions() const
Definition bdlt_packedcalendar.h:2921
HolidayCodeConstIterator beginHolidayCodes(const Date &date) const
WeekendDaysTransitionSequence::const_iterator WeekendDaysTransitionConstIterator
Definition bdlt_packedcalendar.h:645
PackedCalendar_HolidayCodeConstIterator HolidayCodeConstIterator
Definition bdlt_packedcalendar.h:633
void removeHolidayCode(const Date &date, int holidayCode)
BusinessDayConstReverseIterator rendBusinessDays() const
Definition bdlt_packedcalendar.h:3130
BusinessDayConstReverseIterator rbeginBusinessDays() const
Definition bdlt_packedcalendar.h:3072
BusinessDayConstIterator endBusinessDays() const
Definition bdlt_packedcalendar.h:2877
void addWeekendDay(DayOfWeek::Enum weekendDay)
int numBusinessDays() const
Definition bdlt_packedcalendar.h:3047
STREAM & bdexStreamIn(STREAM &stream, int version)
Definition bdlt_packedcalendar.h:2353
void addWeekendDaysTransition(const Date &startDate, const DayOfWeekSet &weekendDays)
void reserveHolidayCapacity(int numHolidays)
Definition bdlt_packedcalendar.h:2334
bool isNonBusinessDay(const Date &date) const
Definition bdlt_packedcalendar.h:3009
HolidayConstIterator beginHolidays() const
Definition bdlt_packedcalendar.h:2850
const Date & lastDate() const
Definition bdlt_packedcalendar.h:3033
bdlt::CalendarReverseIteratorAdapter< HolidayCodeConstIterator > HolidayCodeConstReverseIterator
Definition bdlt_packedcalendar.h:642
WeekendDaysTransitionPrivate WeekendDaysTransition
Definition bdlt_packedcalendar.h:627
bool isHoliday(const Date &date) const
Definition bdlt_packedcalendar.h:2988
HolidayCodeConstReverseIterator rbeginHolidayCodes(const Date &date) const
Definition bdlt_packedcalendar.h:3088
void swap(PackedCalendar &other)
void intersectNonBusinessDays(const PackedCalendar &other)
WeekendDaysTransition weekendDaysTransition(int index) const
Definition bdlt_packedcalendar.h:3188
HolidayCodeConstIterator endHolidayCodes(const Date &date) const
HolidayConstIterator endHolidays() const
Definition bdlt_packedcalendar.h:2901
~PackedCalendar()
Destroy this object.
void unionNonBusinessDays(const PackedCalendar &other)
bool isInRange(const Date &date) const
Definition bdlt_packedcalendar.h:3003
void intersectBusinessDays(const PackedCalendar &other)
bsl::reverse_iterator< WeekendDaysTransitionSequence::const_iterator > WeekendDaysTransitionConstReverseIterator
Definition bdlt_packedcalendar.h:649
bdlt::CalendarReverseIteratorAdapter< BusinessDayConstIterator > BusinessDayConstReverseIterator
Definition bdlt_packedcalendar.h:636
bslma::Allocator * allocator() const
Return the allocator used by this object to supply memory.
Definition bdlt_packedcalendar.h:3199
int length() const
Definition bdlt_packedcalendar.h:3041
bdlt::Date holiday(int index) const
Definition bdlt_packedcalendar.h:2953
static int maxSupportedBdexVersion()
Definition bdlt_packedcalendar.h:3287
STREAM & bdexStreamOut(STREAM &stream, int version) const
Definition bdlt_packedcalendar.h:3205
PackedCalendar(const PackedCalendar &original, bslma::Allocator *basicAllocator=0)
int addHolidayIfInRange(const Date &date)
Definition bdlt_packedcalendar.h:2324
int numWeekendDaysTransitions() const
Definition bdlt_packedcalendar.h:3065
PackedCalendar & operator=(const PackedCalendar &rhs)
WeekendDaysTransitionConstIterator beginWeekendDaysTransitions() const
Definition bdlt_packedcalendar.h:2870
BusinessDayConstIterator beginBusinessDays() const
Definition bdlt_packedcalendar.h:2826
HolidayConstReverseIterator rendHolidays() const
Definition bdlt_packedcalendar.h:3164
WeekendDaysTransitionConstReverseIterator rbeginWeekendDaysTransitions() const
Definition bdlt_packedcalendar.h:3122
friend bool operator==(const PackedCalendar &, const PackedCalendar &)
void addDay(const Date &date)
bool isWeekendDay(const Date &date) const
int numHolidayCodes(const Date &date) const
int addHolidayCodeIfInRange(const Date &date, int holidayCode)
Definition bdlt_packedcalendar.h:2314
PackedCalendar_BusinessDayConstIterator BusinessDayConstIterator
Definition bdlt_packedcalendar.h:629
friend void hashAppend(HASHALG &hashAlg, const PackedCalendar &)
Definition bslstl_pair.h:1210
Definition bslstl_vector.h:1025
AllocatorTraits::size_type size_type
Definition bslstl_vector.h:1052
VALUE_TYPE * iterator
Definition bslstl_vector.h:1057
VALUE_TYPE const * const_iterator
Definition bslstl_vector.h:1058
static void swap(T *a, T *b)
Definition bslalg_swaputil.h:194
Definition bslma_allocator.h:457
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_PRECONDITIONS_END()
Definition bsls_preconditions.h:131
#define BSLS_PRECONDITIONS_BEGIN()
Definition bsls_preconditions.h:130
void hashAppend(HASH_ALGORITHM &hashAlg, const baljsn::EncoderTestAddress &object)
Definition baljsn_encoder_testtypes.h:9236
Definition bbldc_basicisma30360.h:112
Calendar_BusinessDayConstIter operator++(Calendar_BusinessDayConstIter &iterator, int)
Definition bdlt_calendar.h:2156
bool operator==(const Calendar &lhs, const Calendar &rhs)
Date operator-(const Date &date, int numDays)
bsl::ostream & operator<<(bsl::ostream &stream, const Calendar &calendar)
void hashAppend(HASHALG &hashAlg, const Calendar &object)
bool operator!=(const Calendar &lhs, const Calendar &rhs)
Calendar_BusinessDayConstIter operator--(Calendar_BusinessDayConstIter &iterator, int)
Definition bdlt_calendar.h:2165
Definition balxml_encoderoptions.h:68
static PackedIntArrayConstIterator< TYPE > upperBound(PackedIntArrayConstIterator< TYPE > first, PackedIntArrayConstIterator< TYPE > last, TYPE value)
Definition bdlc_packedintarrayutil.h:216
static PackedIntArrayConstIterator< TYPE > lowerBound(PackedIntArrayConstIterator< TYPE > first, PackedIntArrayConstIterator< TYPE > last, TYPE value)
Definition bdlc_packedintarrayutil.h:186
Enum
Enumerated day-of-week values.
Definition bdlt_dayofweek.h:123
TYPE first
Definition bslstl_pair.h:605
TYPE second
Definition bslstl_pair.h:908
Definition bslma_usesbslmaallocator.h:343