AceTime
0.5
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.
|
Class that allows looking up the ZoneInfo (ZI) from its TZDB identifier (e.g. More...
#include <ZoneRegistrar.h>
Public Member Functions | |
ZoneRegistrar (uint16_t registrySize, const ZI *const *zoneRegistry) | |
Constructor. More... | |
uint16_t | registrySize () const |
Return the number of zones. More... | |
bool | isSorted () const |
Return true if zoneRegistry is sorted, and eligible to use a binary search. | |
const ZI * | getZoneInfoForIndex (uint16_t i) const |
const ZI * | getZoneInfoForName (const char *name) const |
Return the ZoneInfo corresponding to the given zone name. More... | |
const ZI * | getZoneInfoForId (uint32_t zoneId) const |
Static Protected Member Functions | |
static bool | isSorted (const ZI *const *zr, uint16_t registrySize) |
static const ZI * | linearSearch (const ZI *const *zr, uint16_t registrySize, const char *name) |
static const ZI * | binarySearch (const ZI *const *zr, uint16_t registrySize, const char *name) |
static const ZI * | linearSearchUsingId (const ZI *const *zr, uint16_t registrySize, uint32_t zoneId) |
Protected Attributes | |
uint16_t const | mRegistrySize |
const ZI *const *const | mZoneRegistry |
bool const | mIsSorted |
Static Protected Attributes | |
static const uint8_t | kBinarySearchThreshold = 6 |
Use binarySearch() if registrySize >= threshold. More... | |
Class that allows looking up the ZoneInfo (ZI) from its TZDB identifier (e.g.
"America/Los_Angeles"), or index, or zoneId (hash from its name).
ZI | ZoneInfo type (e.g. basic::ZoneInfo) |
ZRB | ZoneRegistryBroker type (e.g. basic::ZoneRegistryBroker) |
ZIB | ZoneInfoBroker type (e.g. basic::ZoneInfoBroker) |
STRCMP_P | a function that compares a normal string to flash string (e.g strcmp_P()) |
STRCMP_PP | a function that compares 2 flash strings (must be custom written) |
Definition at line 42 of file ZoneRegistrar.h.
|
inline |
Constructor.
Definition at line 45 of file ZoneRegistrar.h.
|
inline |
Return the ZoneInfo corresponding to the given zone name.
Return nullptr if not found.
Definition at line 68 of file ZoneRegistrar.h.
|
inline |
Return the number of zones.
Definition at line 51 of file ZoneRegistrar.h.
|
staticprotected |
Use binarySearch() if registrySize >= threshold.
Definition at line 91 of file ZoneRegistrar.h.