AceTime
3.0.0
Date and time classes for Arduino that support timezones from the TZ Database.
|
ZoneSorterByOffsetAndName, templatized on a ZoneManager (BasicZoneManager, ExtendedZoneManager, or CompleteZoneManager). More...
#include <ZoneSorterByOffsetAndName.h>
Public Member Functions | |
ZoneSorterByOffsetAndName (const ZM &zoneManager) | |
Constructor. More... | |
void | fillIndexes (uint16_t indexes[], uint16_t size) const |
Fill the given array of indexes with index from [0, size). More... | |
void | sortIndexes (uint16_t indexes[], uint16_t size) const |
Sort the given array of indexes by UTC offset, then by name. | |
void | sortIds (uint32_t ids[], uint16_t size) const |
Sort the given array of zone ids by UTC offset, then by name. | |
void | sortNames (const char *names[], uint16_t size) const |
Sort the given array of zone names by UTC offset, then by name. | |
Static Public Member Functions | |
template<typename Z > | |
static int | compareZone (const Z &a, const Z &b) |
Return <0, 0, or >0 depending on whether Zone a is <, ==, or > than Zone b. More... | |
ZoneSorterByOffsetAndName, templatized on a ZoneManager (BasicZoneManager, ExtendedZoneManager, or CompleteZoneManager).
Sorts the array of zones by UTC offset first, then by name.
ZM | ZoneManager |
Definition at line 22 of file ZoneSorterByOffsetAndName.h.
|
inline |
Constructor.
zoneManager | instance of the ZoneManager |
Definition at line 28 of file ZoneSorterByOffsetAndName.h.
|
inlinestatic |
Return <0, 0, or >0 depending on whether Zone a is <, ==, or > than Zone b.
The comparison function is by the zone's last UTC offset in the zoneInfo database, then by name for zones which have the same UTC offset.
We cannot use auto
as the parameter type (apparently, that's a C++14 feature), so we are forced to use template function.
Z | the zone class (i.e. BasicZone, ExtendedZone, ComppleteZone) |
Definition at line 90 of file ZoneSorterByOffsetAndName.h.
|
inline |
Fill the given array of indexes with index from [0, size).
The resulting indexes array can be sorted using sortIndexes().
Definition at line 36 of file ZoneSorterByOffsetAndName.h.