FARGOS/VISTA Object Management Environment Core
..
|
Convenience class to maintain a table of TimePointCache objects. More...
#include <time_point.hpp>
Public Member Functions | |
TimePointCacheTable (const char *tableName="timeCache") | |
~TimePointCacheTable () | |
const TimePointCache & | getCacheEntry (time_t t) |
Returns a TimePointCache entry for the day indicated by the number of seconds since the POSIX epoch. More... | |
Private Attributes | |
TimedMutex | tblLock |
std::map< time_t, TimePointCache * > | timeTable |
Convenience class to maintain a table of TimePointCache objects.
Many applications make repeated references to times covering a small population of dates. Initialization of a TimePointCache object is relatively expensive, often requiring a trip into the kernel to examine the filesystem. A TimePointCacheTable can be used to avoid creating redundant TimePointCache objects along with the unproductive repeated work.
|
inlineexplicit |
|
inline |
|
inline |
Returns a TimePointCache entry for the day indicated by the number of seconds since the POSIX epoch.
t | specifies the time in question |
NOTE: this routine is thread-safe. Records are automatically created as needed. The address of the returned record will not change during the lifetime of the table.
References tblLock, timeTable, and TimedMutex::unlock().
Referenced by LogMessageRecord::formatRecordAsText().
|
private |
Referenced by getCacheEntry().
|
private |
Referenced by getCacheEntry().
![]() | Generated: Tue Jul 28 2020 16:03:27
Support Information |