6 #ifndef ACE_TIME_ZONE_PROCESSOR_CACHE_H
7 #define ACE_TIME_ZONE_PROCESSOR_CACHE_H
9 #include "common/common.h"
10 #include "TimeOffset.h"
11 #include "OffsetDateTime.h"
12 #include "BasicZoneProcessor.h"
13 #include "ExtendedZoneProcessor.h"
25 template <
typename ZP>
30 mZoneProcessors(zoneProcessors)
34 uint8_t
size()
const {
return mSize; }
44 ZP* zoneProcessor = findUsingZoneKey(zoneKey);
45 if (zoneProcessor)
return zoneProcessor;
48 zoneProcessor = &mZoneProcessors[mCurrentIndex];
50 if (mCurrentIndex >= mSize) mCurrentIndex = 0;
51 zoneProcessor->setZoneKey(zoneKey);
67 ZP* findUsingZoneKey(uintptr_t zoneKey) {
68 for (uint8_t i = 0; i < mSize; i++) {
69 ZP* zoneProcessor = &mZoneProcessors[i];
70 if (zoneProcessor->equalsZoneKey(zoneKey)) {
79 uint8_t mCurrentIndex = 0;
80 ZP*
const mZoneProcessors;
87 using BasicZoneProcessorCacheBase =
88 ZoneProcessorCacheBaseTemplate<BasicZoneProcessor>;
94 using ExtendedZoneProcessorCacheBase =
95 ZoneProcessorCacheBaseTemplate<ExtendedZoneProcessor>;
108 template <u
int8_t SIZE>
134 template <u
int8_t SIZE>
158 template <u
int8_t SIZE>
162 template <u
int8_t SIZE>
An implementation of a BasicZoneProcessorCacheBase where the cache of size SIZE is embedded into the ...
A specific implementation of BasicZoneProcessorTemplate that uses ZoneXxxBrokers which read from zone...
An implementation of an ExtendedZoneProcessorCacheBase where the cache of size SIZE is embedded into ...
A specific implementation of ExtendedZoneProcessorTemplate that uses ZoneXxxBrokers which read from z...
The template class of BasicZoneProcessorCacheBase or ExtendedZoneProcessorCacheBase.
ZP * getZoneProcessor(uintptr_t zoneKey)
Get ZoneProcessor from either a ZoneKey, either a basic::ZoneInfo or an extended::ZoneInfo.
ZP * getZoneProcessorAtIndex(uint8_t i)
Get the ZoneProcessor at index i.
uint8_t size() const
Return the size of the cache.