AceTime
1.7.4
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
|
A templatized implementation of ZoneManager that binds the ZoneRegistrar with the corresponding (Basic|Extended)ZoneProcessorCache. More...
#include <ZoneManager.h>
Public Member Functions | |
TimeZone | createForZoneName (const char *name) override |
Create a TimeZone for the given zone name (e.g. More... | |
TimeZone | createForZoneId (uint32_t id) override |
Create a TimeZone for the given 32-bit zoneId. | |
TimeZone | createForZoneIndex (uint16_t index) override |
Create a TimeZone for the given index in the ZoneInfo registry that was used to create this ZoneManager. | |
TimeZone | createForTimeZoneData (const TimeZoneData &d) override |
Create a TimeZone from the TimeZoneData created by TimeZone::toTimeZoneData(). | |
uint16_t | indexForZoneName (const char *name) const override |
Find the registry index for the given time zone name. More... | |
uint16_t | indexForZoneId (uint32_t id) const override |
Find the registry index for the given time zone id. More... | |
uint16_t | zoneRegistrySize () const override |
Return the number of elements in the Zone (and fat Link) registry. More... | |
uint16_t | linkRegistrySize () const override |
Return the number of elements in the (thin) Link registry. | |
TimeZone | createForZoneInfo (const ZI *zoneInfo) |
Create a TimeZone from an explicit ZoneInfo reference. More... | |
Protected Member Functions | |
ZoneManagerImpl (uint16_t zoneRegistrySize, const ZI *const *zoneRegistry, uint16_t linkRegistrySize, const LE *linkRegistry) | |
Constructor. More... | |
Additional Inherited Members | |
![]() | |
static const uint16_t | kInvalidIndex = 0xffff |
Registry index which is not valid. More... | |
A templatized implementation of ZoneManager that binds the ZoneRegistrar with the corresponding (Basic|Extended)ZoneProcessorCache.
Applications will normally use two specific instantiation of this class: BasicZoneManager<SIZE> and ExtendedZoneManager<SIZE>.
If an entry in the ZoneRegistrar is not found, then TimeZone::forError() will be returned.
If a ZoneProcessor exists in the ZoneProcessorCache that is already bound to the given ZoneInfo, then the ZoneProcessor is reused. If not, another ZoneProcessor is picked from the cache in a round-robin fashion (kicking off the previously bound TimeZone). The type of the TimeZone will be assigned based on the ZoneProcessor, which will be either kTypeBasic or kTypeExtended.
ZI | type of ZoneInfo (basic::ZoneInfo or extended::ZoneInfo) which make up the zone registry |
ZRR | class of ZoneRegistrar which holds the registry of ZoneInfo (e.g. basic::ZoneRegistrar, extended::ZoneRegistrar) |
LE | type of LinkEntry (basic::LinkEntry or extended::LinkEntry) which make up the link registry |
LRR | class of LinkRegistrar which holds the registry of ZoneInfo (e.g. basic::LinkRegistrar, extended::LinkRegistrar) |
ZP | class of ZoneProcessor (e.g. BasicZoneProcessor, ExtendedZoneProcessor) |
ZPC | class of ZoneProcessorCache (e.g. BasicZoneProcessorCache, ExtendedZoneProcessorCache) |
Definition at line 157 of file ZoneManager.h.
|
inlineprotected |
Constructor.
zoneRegistrySize | number of ZoneInfo entries in zoneRegistry |
zoneRegistry | an array of ZoneInfo entries |
linkRegistrySize | number of LinkEntry entries in linkRegistry |
linkRegistry | an array of LinkEntry entries |
Definition at line 238 of file ZoneManager.h.
|
inline |
Create a TimeZone from an explicit ZoneInfo reference.
The ZoneRegistrar will be bypassed because the ZoneInfo is already available, but the TimeZone will use a ZoneProcessor from its ZoneProcessorCache. This is expected to be used mostly in tests, but it could be useful for applications.
Definition at line 222 of file ZoneManager.h.
|
inlineoverridevirtual |
Create a TimeZone for the given zone name (e.g.
"America/Los_Angeles").
Implements ace_time::ZoneManager.
Definition at line 159 of file ZoneManager.h.
|
inlineoverridevirtual |
Find the registry index for the given time zone id.
Returns kInvalidIndex if not found.
Implements ace_time::ZoneManager.
Definition at line 203 of file ZoneManager.h.
|
inlineoverridevirtual |
Find the registry index for the given time zone name.
Returns kInvalidIndex if not found.
Implements ace_time::ZoneManager.
Definition at line 199 of file ZoneManager.h.
|
inlineoverridevirtual |
Return the number of elements in the Zone (and fat Link) registry.
Previously named registrySize().
Implements ace_time::ZoneManager.
Definition at line 207 of file ZoneManager.h.