[#BloombergLP-bdlt-TimetableCache] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlt.adoc[bdlt]::TimetableCache :relfileprefix: ../../ :mrdocs: Efficient cache of read‐only `bdlt::Timetable` objects. == Synopsis Declared in `<bdlt_timetablecache.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class TimetableCache; ---- == Description 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. This container is _exception_ _neutral_ with no guarantee of rollback: if an exception is thrown during the invocation of a method on a pre‐existing instance, the container is left in a valid state, but its value is undefined. In no event is memory leaked. This class is fully thread‐safe (see `bsldoc_glossary`). == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlt/TimetableCache/2constructor-07.adoc[`TimetableCache`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlt/TimetableCache/2destructor.adoc[`~TimetableCache`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/bdlt/TimetableCache/getTimetable.adoc[`getTimetable`] | Return a shared pointer to the named timetable, loading it if needed. | xref:BloombergLP/bdlt/TimetableCache/invalidate.adoc[`invalidate`] | Invalidate and remove the named timetable from this cache. | xref:BloombergLP/bdlt/TimetableCache/invalidateAll.adoc[`invalidateAll`] | Invalidate and remove all timetables from this cache. | xref:BloombergLP/bdlt/TimetableCache/lookupLoadTime.adoc[`lookupLoadTime`] | Return the UTC datetime when the named timetable was loaded. | xref:BloombergLP/bdlt/TimetableCache/lookupTimetable.adoc[`lookupTimetable`] | Look up a timetable by name without loading it. | xref:BloombergLP/bdlt/TimetableCache/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<TimetableCache, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#