AceTime
1.1
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.
|
The classes provide a thin layer of indirection for accessing the zoneinfo files stored in the zonedb/ and zonedbx/ directories. More...
Go to the source code of this file.
Classes | |
class | ace_time::basic::ZoneRuleBroker |
Data broker for accessing ZoneRule. More... | |
class | ace_time::basic::ZonePolicyBroker |
Data broker for accessing ZonePolicy. More... | |
class | ace_time::basic::ZoneEraBroker |
Data broker for accessing ZoneEra. More... | |
class | ace_time::basic::ZoneInfoBroker |
Data broker for accessing ZoneInfo. More... | |
class | ace_time::basic::ZoneRegistryBroker |
Data broker for accessing the ZoneRegistry. More... | |
class | ace_time::extended::ZoneRuleBroker |
Data broker for accessing ZoneRule. More... | |
class | ace_time::extended::ZonePolicyBroker |
Data broker for accessing ZonePolicy. More... | |
class | ace_time::extended::ZoneEraBroker |
Data broker for accessing ZoneEra. More... | |
class | ace_time::extended::ZoneInfoBroker |
Data broker for accessing ZoneInfo. More... | |
class | ace_time::extended::ZoneRegistryBroker |
Data broker for accessing the ZoneRegistry. More... | |
Functions | |
uint16_t | ace_time::internal::timeCodeToMinutes (uint8_t code, uint8_t modifier) |
Convert (timeCode, timeModifier) fields in zoneinfo to minutes. More... | |
uint8_t | ace_time::internal::toSuffix (uint8_t modifier) |
Extract the 'w', 's' 'u' suffix from the 'modifier' field, so that they can be compared against kSuffixW, kSuffixS and kSuffixU. | |
int16_t | ace_time::extended::toDeltaMinutes (int8_t deltaCode) |
int16_t | ace_time::extended::toOffsetMinutes (int8_t offsetCode, int8_t deltaCode) |
The classes provide a thin layer of indirection for accessing the zoneinfo files stored in the zonedb/ and zonedbx/ directories.
When ACE_TIME_USE_PROGMEM or ACE_TIME_USE_PROGMEM are enabled, the zoneinfo files are stored in flash memory (using the PROGMEM keyword), and cannot be accessed directly on microcontrollers using the Harvard architecture (e.g. AVR) where data and program live in 2 different address spaces. The data in flash memory must be accessed using helper routines in <pgmspace.h>. These classes abstract away this difference so that the code BasicZoneProcessor and ExtendedZoneProcessor can be written to be (mostly) agnostic to how the zoneinfo files are stored.
When ACE_TIME_USE_PROGMEM are disabled, the compiler will optimize away this entire abstraction layer, so the resulting machine code is no bigger than (and in most cases, identifical to) accessing the zoneinfo files directly.
The abstraction layer is thin enough that the code in BasicZoneProcessor and ExtendedZoneProcessor did not change very much. It was mostly a mechanical source code replacement of direct zoneinfo access to using these data brokers.
The helper functions live in the internal:: namespace. The classes are somewhat duplicated between the 'basic' and 'extended' namespaces. They used to be identical so that they could be templatized. But supporting one-minute resolution for 'extended' meant that the implementations diverged, so I had to manual duplicate the classes.
Definition in file Brokers.h.