AceTime  0.1
Date and time classes for Arduino that supports the TZ DAtabase, and a system clock synchronized from an NTP server or an RTC chip.
Public Member Functions | Friends | List of all members
ace_time::ExtendedZoneSpecifier Class Reference

An implementation of ZoneSpecifier that works for all zones defined by the TZ Database (with some zones suffering a slight loss of accurancy described below). More...

#include <ExtendedZoneSpecifier.h>

Inheritance diagram for ace_time::ExtendedZoneSpecifier:
Inheritance graph
[legend]
Collaboration diagram for ace_time::ExtendedZoneSpecifier:
Collaboration graph
[legend]

Public Member Functions

 ExtendedZoneSpecifier (const extended::ZoneInfo *zoneInfo)
 Constructor. More...
 
const extended::ZoneInfogetZoneInfo () const
 Return the underlying ZoneInfo. More...
 
TimeOffset getUtcOffset (acetime_t epochSeconds) const override
 Return the total UTC offset at epochSeconds, including DST offset. More...
 
TimeOffset getDeltaOffset (acetime_t epochSeconds) const override
 Return the DST delta offset at epochSeconds. More...
 
const char * getAbbrev (acetime_t epochSeconds) const override
 Return the time zone abbreviation at epochSeconds. More...
 
TimeOffset getUtcOffsetForDateTime (const LocalDateTime &ldt) const override
 Return the UTC offset matching the given the date/time components. More...
 
void printTo (Print &printer) const override
 Print a human-readable identifier. More...
 
void log () const
 Used only for debugging. More...
 
void resetTransitionHighWater ()
 Reset the TransitionStorage high water mark. More...
 
uint8_t getTransitionHighWater () const
 Get the TransitionStorage high water mark. More...
 
- Public Member Functions inherited from ace_time::ZoneSpecifier
uint8_t getType () const
 Return the kTypeXxx of the current instance. More...
 

Friends

class ::ExtendedZoneSpecifierTest_compareEraToYearMonth
 
class ::ExtendedZoneSpecifierTest_createMatch
 
class ::ExtendedZoneSpecifierTest_findMatches_simple
 
class ::ExtendedZoneSpecifierTest_findMatches_named
 
class ::ExtendedZoneSpecifierTest_findCandidateTransitions
 
class ::ExtendedZoneSpecifierTest_findTransitionsFromNamedMatch
 
class ::ExtendedZoneSpecifierTest_getTransitionTime
 
class ::ExtendedZoneSpecifierTest_createTransitionForYear
 
class ::ExtendedZoneSpecifierTest_normalizeDateTuple
 
class ::ExtendedZoneSpecifierTest_expandDateTuple
 
class ::ExtendedZoneSpecifierTest_calcInteriorYears
 
class ::ExtendedZoneSpecifierTest_getMostRecentPriorYear
 
class ::ExtendedZoneSpecifierTest_compareTransitionToMatchFuzzy
 
class ::ExtendedZoneSpecifierTest_compareTransitionToMatch
 
class ::ExtendedZoneSpecifierTest_processActiveTransition
 
class ::ExtendedZoneSpecifierTest_fixTransitionTimes_generateStartUntilTimes
 
class ::ExtendedZoneSpecifierTest_createAbbreviation
 

Additional Inherited Members

- Static Public Attributes inherited from ace_time::ZoneSpecifier
static const uint8_t kTypeManual = 1
 Indicate ManualZoneSpecifier. More...
 
static const uint8_t kTypeBasic = 2
 Indicate BasicZoneSpecifier. More...
 
static const uint8_t kTypeExtended = 3
 Indicate ExtendedZoneSpecifier. More...
 
- Protected Member Functions inherited from ace_time::ZoneSpecifier
 ZoneSpecifier (const ZoneSpecifier &)=default
 
ZoneSpecifieroperator= (const ZoneSpecifier &)=default
 
 ZoneSpecifier (uint8_t type)
 Constructor. More...
 
- Protected Attributes inherited from ace_time::ZoneSpecifier
uint8_t mType
 

Detailed Description

An implementation of ZoneSpecifier that works for all zones defined by the TZ Database (with some zones suffering a slight loss of accurancy described below).

The supported zones are defined in the zonedbx/zone_infos.h header file. The constructor expects a pointer to one of the ZoneInfo structures declared in the zonedbx/zone_infos.h file. The zone_specifier.py file is a Python implementation of this class.

Just like BasicZoneSpecifier, UTC offsets are stored as a single signed byte in units of 15-minute increments to save memory. Fortunately, all current (year 2019) time zones have DST offsets at 15-minute boundaries. But in addition to the DST offset, this class uses a single signed byte to store the time at which a timezone changes the DST offset.

There are current 5 timezones whose DST transition times are at 00:01 (i.e. 1 minute after midnight). Those transition times are truncated down by tzcompiler.py to the nearest 15-minutes, in other words to 00:00. Those zones are:

Not thread-safe.

Definition at line 631 of file ExtendedZoneSpecifier.h.

Constructor & Destructor Documentation

ace_time::ExtendedZoneSpecifier::ExtendedZoneSpecifier ( const extended::ZoneInfo zoneInfo)
inlineexplicit

Constructor.

Parameters
zoneInfopointer to a ZoneInfo. Must not be nullptr.

Definition at line 637 of file ExtendedZoneSpecifier.h.

Member Function Documentation

const char* ace_time::ExtendedZoneSpecifier::getAbbrev ( acetime_t  epochSeconds) const
inlineoverridevirtual

Return the time zone abbreviation at epochSeconds.

This is an experimental method that has not been tested thoroughly. Use with caution.

Implements ace_time::ZoneSpecifier.

Definition at line 661 of file ExtendedZoneSpecifier.h.

TimeOffset ace_time::ExtendedZoneSpecifier::getDeltaOffset ( acetime_t  epochSeconds) const
inlineoverridevirtual

Return the DST delta offset at epochSeconds.

This is an experimental method that has not been tested thoroughly. Use with caution.

Implements ace_time::ZoneSpecifier.

Definition at line 654 of file ExtendedZoneSpecifier.h.

uint8_t ace_time::ExtendedZoneSpecifier::getTransitionHighWater ( ) const
inline

Get the TransitionStorage high water mark.

For debugging.

Definition at line 701 of file ExtendedZoneSpecifier.h.

TimeOffset ace_time::ExtendedZoneSpecifier::getUtcOffset ( acetime_t  epochSeconds) const
inlineoverridevirtual

Return the total UTC offset at epochSeconds, including DST offset.

Implements ace_time::ZoneSpecifier.

Definition at line 644 of file ExtendedZoneSpecifier.h.

TimeOffset ace_time::ExtendedZoneSpecifier::getUtcOffsetForDateTime ( const LocalDateTime ldt) const
inlineoverridevirtual

Return the UTC offset matching the given the date/time components.

Implements ace_time::ZoneSpecifier.

Definition at line 668 of file ExtendedZoneSpecifier.h.

const extended::ZoneInfo* ace_time::ExtendedZoneSpecifier::getZoneInfo ( ) const
inline

Return the underlying ZoneInfo.

Definition at line 642 of file ExtendedZoneSpecifier.h.

void ace_time::ExtendedZoneSpecifier::log ( ) const
inline

Used only for debugging.

Definition at line 683 of file ExtendedZoneSpecifier.h.

void ace_time::ExtendedZoneSpecifier::printTo ( Print &  printer) const
overridevirtual

Print a human-readable identifier.

Implements ace_time::ZoneSpecifier.

Definition at line 18 of file ExtendedZoneSpecifier.cpp.

void ace_time::ExtendedZoneSpecifier::resetTransitionHighWater ( )
inline

Reset the TransitionStorage high water mark.

For debugging.

Definition at line 696 of file ExtendedZoneSpecifier.h.


The documentation for this class was generated from the following files: