BloombergLP::bdlt

Namespace for date and time types in the bdl package group.

Types

NameDescription
Calendar This class implements a runtime-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.
CalendarCache This class implements an efficient cache of read-only bdlt::Calendar objects that are loaded into the cache, using a calendar loader supplied at construction, as a side-effect of the getCalendar manipulator. Calendars in the cache can be invalidated, and removed from the cache via the invalidate and invalidateAll methods. In addition, calendars in the cache can be made to expire based on a timeout that may be optionally supplied at construction. The bsl::shared_ptr<const bdlt::Calendar> objects returned from the getCalendar and lookupCalendar methods allow for the safe removal of calendars from the cache that may still have outstanding references to them.
CalendarCache_Entry This class defines the type of objects that are inserted into the calendar cache. Each entry contains a shared pointer to a read-only calendar and the time at which that calendar was loaded. Note that an explicit allocator is required to create an entry object.
CalendarLoader This class defines a protocol used to load calendars from a specific source. Each repository of calendar information can be supported by a distinct implementation of this protocol.
CalendarReverseIteratorAdapter This reverse iterator adapter provides a subset of the bsl::reverse_iterator interface that can be used with the calendar iterators defined in bdlt. Specifically, the types value_type, difference_type, pointer, and reference are defined but iterator_category is not defined (since this is not a fully-compliant iterator). Furthermore, the methods appropriate for random-access iterators are not included (e.g., operator+=).
CalendarUtil This struct provides a namespace for utility functions that operate on dates in the context of supplied calendars.
Calendar_BusinessDayConstIter Provide read-only, sequential access in increasing (chronological) order to the business days in a Calendar object.
CurrentTime This struct provides a namespace for current-time-retrieval procedures including a configurable global callback mechanism. The use of a subset of these procedures is thread-safe (see Thread Safety).
Date This class implements a complex-constrained, value-semantic type for representing dates according to the Unix (POSIX) calendar. Each object of this class always represents a valid date value in the range [0001JAN01 .. 9999DEC31] inclusive. The interface of this class supports Date values expressed in terms of either year/month/day (the canonical representation) or year/day-of-year (an alternate representation). See []Date Values and Their Representations) for details.
DateFormatter This class provides a specifier formatter for printing Date objects.
DateFormatter_Cache This class facilitates faster access to a Date object during printing by batching access to several fields in a single call during construction and caching them for quick access later.
DateTz This value-semantic class describes a date value in a particular time zone, which is indicated using an offset from UTC (in minutes).
DateTzFormatter This class provides a specifier formatter for printing DateTz objects.
DateTzFormatter_Cache This class facilitates faster access to a DateTz object during printing by batching access to several fields in a single call during construction and caching them for quick access later.
DateUtil This struct provides a namespace for utility functions that provide non-primitive operations on dates.
Datetime This class implements a simply-constrained value-semantic type representing the composition of date and time values. Valid date values for the "date" part of a Datetime object are the same as those defined for Date objects; similarly, valid time values for the "time" part of a Datetime object are similar to those defined for Time objects (but with additional precision). Relational operators are disallowed on Datetime objects whose "time" part has the same value as that of a default constructed Time object.
DatetimeFormatter This class provides a specifier formatter for printing Datetime objects.
DatetimeFormatter_Cache This class facilitates faster access to a Datetime object during printing by batching access to several fields per call during construction and caching them for quick access later.
DatetimeImpUtil This struct provides a namespace for datetime encoding constants.
DatetimeInterval Each object of this class represents a (signed) time interval with microsecond resolution. See {The Representation of a Time Interval} for details.
DatetimeIntervalUtil This utility struct provides a namespace for a suite of functions operating on objects of type DatetimeInterval.
DatetimeTz This value-semantic class describes a datetime value in a particular time zone, which is indicated using an offset from UTC (in minutes).
DatetimeTzFormatter This class provides a specifier formatter for printing DatetimeTz objects.
DatetimeTzFormatter_Cache This class facilitates faster access to a DatetimeTz object during printing by batching access to several fields per call during construction and caching them for quick access later.
DatetimeUtil This utility struct provides a namespace for a suite of functions operating on objects of type Datetime.
DayOfWeek This struct provides a namespace for enumerating day-of-week values. See Enum in the TYPES sub-section for details.
DayOfWeekSet This class implements an efficient value-semantic, ordered set of DayOfWeek values. This set requires a fixed capacity, and all operations operate in constant time, and provide the no-throw guarantee.
DayOfWeekSet_Iter Implementation of standard bidirectional iterator for DayOfWeekSet. Any modification of a DayOfWeekSet will invalidate any iterators referring to that DayOfWeekSet.
DayOfWeekUtil This struct provides a namespace for common non-primitive procedures that operate on bdlt::DayOfWeek::Enum values.
DefaultCalendarCache This struct provides a namespace for functions that manage the lifetime of, and access to, a process-wide default bdlt::CalendarCache object. The default cache is initialized by an explicit call to the initialize class method, and destroyed by the destroy class method. The default cache may be initialized and destroyed multiple times during the lifetime of a process. The lifetimes of the calendar loader and memory allocator supplied to initialize must extend beyond the following (matching) call to destroy.
DefaultTimetableCache This struct provides a namespace for functions that manage the lifetime of, and access to, a process-wide default bdlt::TimetableCache object. The default cache is initialized by an explicit call to the initialize class method, and destroyed by the destroy class method. The default cache may be initialized and destroyed multiple times during the lifetime of a process. The lifetimes of the timetable loader and memory allocator supplied to initialize must extend beyond the following (matching) call to destroy.
EpochUtil This struct provides a namespace for a suite of non-primitive functions providing conversions between absolute Datetime values and corresponding relative time intervals with respect to the Unix standard epoch time, returned by the epoch method. These methods are alias-safe, thread-safe, and exception-neutral. Functions are provided for returning converted values by value or through a result pointer.
FixUtil This struct provides a namespace for a suite of pure functions that perform conversions between objects of bdlt vocabulary type and their FIX representations. Each generate and generateRaw method takes a bdlt object (of type Date, DateTz, Time, TimeTz, Datetime, or DatetimeTz) and outputs its corresponding FIX representation to a user-supplied character buffer or bsl::ostream. The parse methods effect the opposite conversion in that they populate a bdlt object from the result of parsing a FIX representation.
FixUtilConfiguration This unconstrained (value-semantic) attribute class characterizes how to configure certain behavior in FixUtil functions. Currently, only the generate and generateRaw methods of that utility are affected by FixUtilConfiguration settings. See the section for information on the class attributes.
FormatTestUtil This struct serves as a namespace for static functions to facilitate testing of formatting of bdlt value types -- used in the implementation of the above macros, and for conversion between bsl::string and bsl::wstring.
FormatUtil This class serves as a namespace for some static functions that are useful in creating specializations of bsl::formatter to support bsl::format.
Formatter
FuzzUtil This utility struct provides a namespace for a suite of functions that produce objects of date and time values from fuzz data.
IntervalConversionUtil This utility struct, IntervalConversionUtil, defines functions to convert between bsls::TimeInterval and bdlt::DatetimeInterval representations of time intervals.
Iso8601Util This struct provides a namespace for a suite of pure functions that perform conversions between objects of bdlt vocabulary type and their ISO 8601 representations. Each generate and generateRaw method takes a bdlt object (of type Date, DateTz, Time, TimeTz, Datetime, or DatetimeTz) and outputs its corresponding ISO 8601 representation to a user-supplied character buffer or bsl::ostream. The parse methods effect the opposite conversion in that they populate a bdlt object from the result of parsing an ISO 8601 representation.
Iso8601UtilConfiguration This unconstrained (value-semantic) attribute class characterizes how to configure certain behavior in Iso8601Util functions. Currently, only the generate and generateRaw methods of that utility are affected by Iso8601UtilConfiguration settings. See the section for information on the class attributes.
Iso8601UtilParseConfiguration This unconstrained (value-semantic) attribute class characterizes how to configure certain behavior in Iso8601Util functions. See the section for information on the class attributes.
Literal_SpecifierFormatter This class does parsing and output of sequences whose corresponding output is independent of the type and value of the object being formatted.
LocalTimeOffset This struct provides a namespace for local-time-offset procedures including a configurable global callback mechanism. The use of these procedures is thread-safe (see Thread Safety).
MonthOfYear This struct provides a namespace for enumerating month-of-year values. See Enum in the TYPES sub-section for details.
PackedCalendar 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.
PackedCalendar_BusinessDayConstIterator Provide read-only, sequential access in increasing (chronological) order to the business days in a PackedCalendar object.
PackedCalendar_DateProxy This class serves as a proxy for Date for use by the arrow operator of calendar iterators (e.g., PackedCalendar_HolidayConstIterator). An object of this class behaves as the Date object with which it was constructed.
PackedCalendar_DateRef This private class is used by the arrow operator of the holiday iterator and business day iterator classes. The objects instantiated from this class serve as references to Date objects.
PackedCalendar_HolidayCodeConstIterator Provide read-only, sequential access in increasing (numerical) order to the holiday codes in a PackedCalendar object.
PackedCalendar_HolidayConstIterator Provide read-only, sequential access in increasing (chronological) order to the holidays in a PackedCalendar object. This class owns an iterator into the bdlc::PackedIntArray storing the holiday offsets of the referenced bdlt::PackedCalendar and a date, d_firstDate, to convert the offsets into dates corresponding to holidays.
PosixDateImpUtil This struct provides a namespace for a suite of pure functions that perform low-level operations on date values in a variety of formats. Note that all of these functions, whether or not implemented in terms of a static cache, are stateless, and, as such, are inherently thread-safe.
ProlepticDateImpUtil This struct provides a namespace for a suite of pure functions that perform low-level operations on date values in a variety of formats: year/month/day, year/day-of-year, and serial date. Dates in the range [0001/01/01 .. 9999/12/31] that are valid per the proleptic Gregorian calendar are supported, with serial date 1 (3652059) corresponding to 0001/01/01 (9999/12/31). Note that all of the functions, whether or not implemented in terms of a static cache, are stateless, and, as such, are inherently thread-safe.
Time This class implements a value-semantic type that represents the time of day to a resolution of one microsecond. Each object of this (almost) simply constrained attribute class always represents a valid time value to a resolution of one microsecond. The valid range for times is 00:00:00.000000 through 23:59:59.999999, except that 24:00:00.000000 represents the default-constructed value. The value 24:00:00.000000 behaves, in most cases, as if it were the value 00:00:00.000000; however, for all relational comparison operators, 24:00:00.000000 is not a valid argument and, therefore, would result in undefined behavior. Each add operation on a Time object returns the (signed) number of times that the 23:59:59.999999 - 00:00:00.000000 boundary was crossed while performing the operation. Attempting to construct a Time with any attribute outside its valid range (or with an hour attribute value of 24 and any other attribute non-zero) has undefined behavior.
TimeFormatter This class provides a specifier formatter for printing Time objects.
TimeFormatter_Cache This class facilitates faster access to a Time object during printing by batching access to several fields in a single call during construction and caching them for quick access later.
TimeTz This value-semantic class describes a time value in a particular time zone, which is indicated using an offset from UTC (in minutes). The offset is available via the offset method, and is defined by the relationship: localTime() - offset() == utcTime. The time and offset values are logically assumed to correspond to geographically valid values, however, this constraint is not enforced.
TimeTzFormatter This class provides a specifier formatter for printing TimeTz objects.
TimeTzFormatter_Cache This class facilitates faster access to a TimeTz object during printing by batching access to several fields in a single call during construction and caching them for quick access later.
TimeUnitRatio This struct provides a namespace for constants characterizing ratios between commonly-used time units.
TimeUtil This struct provides a namespace for common non-primitive procedures that operate on Time objects. These methods are alias-safe and exception-neutral.
TimeZoneFormatter This class provides a specifier formatter for printing time zones.
Timetable This class implements a value-semantic repository of datetime-indexed state transitions over a valid range of dates. This valid range, [firstDate() .. lastDate()], spans the first and last dates of a timetable's accessible contents. A timetable can be "populated" with state transitions via a suite of "add" methods. Note that the behavior of requesting any timetable information for a supplied date whose value is outside the current valid range for that timetable is undefined.
TimetableCache This class implements an efficient cache of read-only bdlt::Timetable objects that are loaded into the cache, using a timetable loader supplied at construction, as a side-effect of the getTimetable manipulator. Timetables in the cache can be invalidated, and removed from the cache via the invalidate and invalidateAll methods. In addition, timetables in the cache can be made to expire based on a timeout that may be optionally supplied at construction. The bsl::shared_ptr<const bdlt::Timetable> objects returned from the getTimetable and lookupTimetable methods allow for the safe removal of timetables from the cache that may still have outstanding references to them.
TimetableCache_Entry This class defines the type of objects that are inserted into the timetable cache. Each entry contains a shared pointer to a read-only timetable and the time at which that timetable was loaded. Note that an explicit allocator is required to create an entry object.
TimetableLoader This class defines a protocol used to load timetables from a specific source. Each repository of timetable information can be supported by a distinct implementation of this protocol.
TimetableTransition This simply-constrained attribute class represents a state transition, implemented as a datetime for when the transition occurs, and a code to indicate the new state.
TimetableTransition_Ref This private class is used by the arrow operator of the timetable iterator class. The objects instantiated from this class serve as references to TimetableTransition objects.
Timetable_CompactableTransition This simply-constrained attribute class represents a state transition, implemented as a time for when the transition occurs, and a code to indicate the new state.
Timetable_ConstIterator Provide read-only, sequential access in increasing (chronological) order to the transitions in a Timetable object.
Timetable_Day This class implements a value-semantic repository of time-indexed state transitions over one date (this class implements one day of a timetable). A Timetable_Day can be "populated" with state transitions via the addTransition method, and queried for the transition code in effect at a specified time via the transitionCodeInEffect method. Note that, as an optimization for the transitionCodeInEffect method, the transition code in effect before the first possible transition is stored in d_initialTransitionCode.

Type Aliases

NameDescription
SerialDateImpUtil Alias for PosixDateImpUtil when proleptic dates are not enabled.

Functions

NameDescription
bdexStreamIn bdexStreamIn overloads
bdexStreamOut bdexStreamOut overloads
hashAppend hashAppend overloads
maxSupportedBdexVersion maxSupportedBdexVersion overloads
operator& Return a set containing the intersection of the specified lhs and rhs sets (i.e., a set containing elements that are in both lhs and rhs).
operator+ Addition operators
operator++ Increment operators
operator- Unary minus operators
operator-- Decrement operators
operator^ Return a set containing the exclusive-or of the specified lhs and rhs sets (i.e., a set containing elements that are either in lhs, but not rhs, or in rhs, but not lhs).
operator| Return a set containing the union of the specified lhs and rhs sets (i.e., a set containing elements that are in either lhs or rhs or both).
operator~ Return a set containing the complement of the specified set (i.e., those members not contained in set).
swap Exchange the values of the specified a and b objects. This function provides the no-throw exception-safety guarantee if the two objects were created with the same allocator and the basic guarantee otherwise.
operator<< Stream insertion operators
operator== Equality operators
operator!= Inequality operators
operator< Less-than operators
operator<= Less-than-or-equal operators
operator> Greater-than operators
operator>= Greater-than-or-equal operators