6 #ifndef ACE_TIME_ZONE_MANAGER_H
7 #define ACE_TIME_ZONE_MANAGER_H
10 #include <AceSorting.h>
11 #include "internal/ZoneRegistrar.h"
12 #include "ZoneProcessorCache.h"
13 #include "TimeZoneData.h"
15 #include "BasicZone.h"
16 #include "ExtendedZone.h"
46 case TimeZoneData::kTypeError:
48 case TimeZoneData::kTypeManual:
57 uint16_t zoneRegistrySize()
const {
return 0; }
84 typename ZI,
typename ZRR,
85 typename ZP,
typename Z
93 const ZI* zoneInfo = mZoneRegistrar.getZoneInfoForName(name);
99 const ZI* zoneInfo = mZoneRegistrar.getZoneInfoForId(
id);
108 const ZI* zoneInfo = mZoneRegistrar.getZoneInfoForIndex(index);
118 case TimeZoneData::kTypeError:
120 case TimeZoneData::kTypeManual:
124 case TimeZoneData::kTypeZoneId:
137 return mZoneRegistrar.findIndexForName(name);
145 return mZoneRegistrar.findIndexForId(
id);
153 return mZoneRegistrar.zoneRegistrySize();
165 ZP* processor = mZoneProcessorCache.getZoneProcessor(
166 (uintptr_t) zoneInfo);
175 const ZI* zoneInfo = this->mZoneRegistrar.getZoneInfoForName(name);
176 if (! zoneInfo)
return nullptr;
177 return this->mZoneProcessorCache.getZoneProcessor((uintptr_t) zoneInfo);
182 const ZI* zoneInfo = this->mZoneRegistrar.getZoneInfoForIndex(index);
191 mZoneProcessorCache.resetZoneProcessors();
203 const ZI*
const* zoneRegistry,
207 mZoneProcessorCache(zoneProcessorCache)
215 const ZRR mZoneRegistrar;
226 basic::ZoneRegistrar,
234 const basic::ZoneInfo*
const* zoneRegistry,
256 extended::ZoneRegistrar,
257 ExtendedZoneProcessor,
264 const extended::ZoneInfo*
const* zoneRegistry,
An implementation of the ZoneManager which uses a registry of basic::ZoneInfo records.
A specific implementation of BasicZoneProcessorTemplate that uses ZoneXxxBrokers which read from zone...
A thin wrapper around a basic::ZoneInfo data structure to provide a stable API access to some useful ...
An implementation of the ZoneManager which uses a registry of extended::ZoneInfo records.
A specific implementation of ExtendedZoneProcessorTemplate that uses ZoneXxxBrokers which read from z...
A thin wrapper around an extended::ZoneInfo data structure to provide a stable API access to some use...
A simple version of ZoneManager that converts a manual TimeZoneData with fixed STD and DST offsets in...
TimeZone createForTimeZoneData(const TimeZoneData &d)
Create a TimeZone with fixed STD and DST offsets stored in the TimeZoneData which was created by Time...
static TimeOffset forMinutes(int16_t minutes)
Create TimeOffset from minutes from 00:00.
Class that describes a time zone.
static TimeZone forError()
Return a TimeZone representing an error condition.
static TimeZone forZoneInfo(const basic::ZoneInfo *zoneInfo, BasicZoneProcessor *zoneProcessor)
Convenience factory method to create from a zoneInfo and an associated BasicZoneProcessor.
static TimeZone forTimeOffset(TimeOffset stdOffset, TimeOffset dstOffset=TimeOffset())
Factory method to create from a UTC offset and an optional DST offset.
A templatized implementation of ZoneManager that binds the ZoneRegistrar with the corresponding (Basi...
TimeZone createForTimeZoneData(const TimeZoneData &d)
Create a TimeZone from the TimeZoneData created by TimeZone::toTimeZoneData().
TimeZone createForZoneId(uint32_t id)
Create a TimeZone for the given 32-bit zoneId.
void resetZoneProcessors()
Reset the transition cache of the zone processors in the cache.
Z getZoneForIndex(uint16_t index) const
Return the Zone wrapper object for the given index.
TimeZone createForZoneName(const char *name)
Create a TimeZone for the given zone name (e.g.
uint16_t indexForZoneName(const char *name) const
Find the registry index for the given time zone name.
TimeZone createForZoneInfo(const ZI *zoneInfo)
Create a TimeZone from an explicit ZoneInfo reference.
uint16_t indexForZoneId(uint32_t id) const
Find the registry index for the given time zone id.
ZP * getZoneProcessor(const char *name)
Return the ZoneProcessor for given zone name.
uint16_t zoneRegistrySize() const
Return the number of elements in the Zone and Fat Link registry.
ZoneManagerTemplate(uint16_t zoneRegistrySize, const ZI *const *zoneRegistry, ZoneProcessorCacheBaseTemplate< ZP > &zoneProcessorCache)
Constructor.
TimeZone createForZoneIndex(uint16_t index)
Create a TimeZone for the given index in the ZoneInfo registry that was used to create this ZoneManag...
Base class for ManualZoneManager, BasicZoneManager, and ExtendedZoneManager to keep ZoneManager::kInv...
static const uint16_t kInvalidIndex
Registry index which is not valid.
The template class of BasicZoneProcessorCacheBase or ExtendedZoneProcessorCacheBase.
Concrete template instantiation of ZoneRegistrarTemplate for basic::ZoneInfo, which can be used with ...
Concrete template instantiation of ZoneRegistrarTemplate for extended::ZoneInfo, which can be used wi...
Data structure that captures the internal state of a TimeZone object with enough information so that ...
uint32_t zoneId
Both TimeZone::kTypeBasic and TimeZone::kTypeExtended are mapped to a TimeZoneData::kTypeZoneId.