AceTime
3.0.0
Date and time classes for Arduino that support timezones from the TZ Database.
|
A templatized implementation of ZoneManager that binds the ZoneRegistrar with the corresponding (Basic|Extended)ZoneProcessorCache. More...
#include <ZoneManager.h>
Public Member Functions | |
ZoneManagerTemplate (uint16_t zoneRegistrySize, const typename D::ZoneInfo *const *zoneRegistry, ZoneProcessorCacheBaseTemplate< ZP > &zoneProcessorCache) | |
Constructor. More... | |
TimeZone | createForZoneName (const char *name) |
Create a TimeZone for the given zone name (e.g. More... | |
TimeZone | createForZoneId (uint32_t id) |
Create a TimeZone for the given 32-bit zoneId. | |
TimeZone | createForZoneIndex (uint16_t index) |
Create a TimeZone for the given index in the ZoneInfo registry that was used to create this ZoneManager. | |
TimeZone | createForTimeZoneData (const TimeZoneData &d) |
Create a TimeZone from the TimeZoneData created by TimeZone::toTimeZoneData(). | |
uint16_t | indexForZoneName (const char *name) const |
Find the registry index for the given time zone name. More... | |
uint16_t | indexForZoneId (uint32_t id) const |
Find the registry index for the given time zone id. More... | |
uint16_t | zoneRegistrySize () const |
Return the number of elements in the Zone and Fat Link registry. More... | |
TimeZone | createForZoneInfo (const typename D::ZoneInfo *zoneInfo) |
Create a TimeZone from an explicit ZoneInfo reference. More... | |
ZP * | getZoneProcessor (const char *name) |
Return the ZoneProcessor for given zone name. More... | |
Z | getZoneForIndex (uint16_t index) const |
Return the Zone wrapper object for the given index. | |
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 and ExtendedZoneManager.
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.
D | container class of the zoneinfo files and brokers |
ZP | zone processor |
Z | zone wrapper class, BasicZone, ExtendedZone, CompleteZone |
Definition at line 81 of file ZoneManager.h.
|
inline |
Constructor.
zoneRegistrySize | number of ZoneInfo entries in zoneRegistry |
zoneRegistry | an array of ZoneInfo entries |
Definition at line 89 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 175 of file ZoneManager.h.
|
inline |
Create a TimeZone for the given zone name (e.g.
"America/Los_Angeles").
Definition at line 101 of file ZoneManager.h.
|
inline |
Return the ZoneProcessor for given zone name.
Mostly for debugging purposes.
Definition at line 186 of file ZoneManager.h.
|
inline |
Find the registry index for the given time zone id.
Returns kInvalidIndex if not found.
Definition at line 156 of file ZoneManager.h.
|
inline |
Find the registry index for the given time zone name.
Returns kInvalidIndex if not found.
Definition at line 148 of file ZoneManager.h.
|
inline |
Return the number of elements in the Zone and Fat Link registry.
Previously named registrySize().
Definition at line 164 of file ZoneManager.h.