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.
Synopsis
Declared in <bdlt_timetablecache.h>
class TimetableCache;
Description
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
Name |
Description |
|
Constructors |
|
Destroy this object. |
Return a shared pointer providing non‐modifiable access to the timetable having the specified |
|
Invalidate the timetable having the specified |
|
Invalidate all timetables in this timetable cache, and remove them from the cache. Return the number of timetables that were invalidated. Note that a timetable that has been invalidated in the cache remains valid to all outstanding references to it, obtained via earlier calls to the |
|
Return the datetime, in Coordinated Universal Time (UTC), at which the timetable having the specified |
|
Return a shared pointer providing non‐modifiable access to the timetable having the specified |
|
|
Created with MrDocs