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 | Public Attributes | Static Public Attributes | List of all members
ace_time::extended::Transition Struct Reference

Represents an interval of time where the time zone obeyed a certain UTC offset and DST delta. More...

#include <ExtendedZoneSpecifier.h>

Collaboration diagram for ace_time::extended::Transition:
Collaboration graph
[legend]

Public Member Functions

const char * format () const
 
int8_t offsetCode () const
 The base offset code. More...
 
const char * letter () const
 Return the letter string. More...
 
int8_t deltaCode () const
 The DST offset code. More...
 
void log () const
 Used only for debugging. More...
 

Public Attributes

const ZoneMatchmatch
 The match which generated this Transition. More...
 
const extended::ZoneRulerule
 The Zone transition rule that matched for the the given year. More...
 
DateTuple transitionTime
 The original transition time, usually 'w' but sometimes 's' or 'u'. More...
 
union {
   DateTuple   transitionTimeS
 Version of transitionTime in 's' mode, using the UTC offset of the previous Transition. More...
 
   DateTuple   startDateTime
 Start time expressed using the UTC offset of the current Transition. More...
 
}; 
 
union {
   DateTuple   transitionTimeU
 Version of transitionTime in 'u' mode, using the UTC offset of the previous transition. More...
 
   DateTuple   untilDateTime
 Until time expressed using the UTC offset of the current Transition. More...
 
}; 
 
DateTuple originalTransitionTime
 If the transition is shifted to the beginning of a ZoneMatch, this is set to the transitionTime for debugging. More...
 
char abbrev [kAbbrevSize]
 The calculated effective time zone abbreviation, e.g. More...
 
acetime_t startEpochSeconds
 The calculated transition time of the given rule. More...
 
bool active
 Determines if this transition is valid. More...
 

Static Public Attributes

static const uint8_t kAbbrevSize = basic::Transition::kAbbrevSize
 Size of the timezone abbreviation. More...
 

Detailed Description

Represents an interval of time where the time zone obeyed a certain UTC offset and DST delta.

The start of the interval is given by 'transitionTime' which comes from the TZ Database file. The actual start and until time of the interval (in the local time zone) is given by 'startDateTime' and 'untilDateTime'.

There are 2 types of Transition instances: 1) Simple, indicated by 'rule' == nullptr. The base UTC offsetCode is given by match->offsetCode. The additional DST delta is given by match->deltaCode. 2) Named, indicated by 'rule' != nullptr. The base UTC offsetCode is given by match->offsetCode. The additional DST delta is given by rule->deltaCode.

Definition at line 146 of file ExtendedZoneSpecifier.h.

Member Function Documentation

int8_t ace_time::extended::Transition::deltaCode ( ) const
inline

The DST offset code.

Definition at line 276 of file ExtendedZoneSpecifier.h.

const char* ace_time::extended::Transition::letter ( ) const
inline

Return the letter string.

Returns nullptr if the RULES column is empty since that means that the ZoneRule is not used, which means LETTER does not exist. A LETTER of '-' is returned as an empty string "".

Not thread safe! (The alternative would be to make Transition.letter into a char[2], making each Transtion be one byte bigger. Maybe that's the better implementation, not sure.)

Definition at line 237 of file ExtendedZoneSpecifier.h.

void ace_time::extended::Transition::log ( ) const
inline

Used only for debugging.

Definition at line 281 of file ExtendedZoneSpecifier.h.

int8_t ace_time::extended::Transition::offsetCode ( ) const
inline

The base offset code.

Note that this is different than basic::Transition::offsetCode used by BasicZoneSpecifier.

Definition at line 224 of file ExtendedZoneSpecifier.h.

Member Data Documentation

char ace_time::extended::Transition::abbrev[kAbbrevSize]

The calculated effective time zone abbreviation, e.g.

"PST" or "PDT".

Definition at line 205 of file ExtendedZoneSpecifier.h.

bool ace_time::extended::Transition::active

Determines if this transition is valid.

Definition at line 212 of file ExtendedZoneSpecifier.h.

const uint8_t ace_time::extended::Transition::kAbbrevSize = basic::Transition::kAbbrevSize
static

Size of the timezone abbreviation.

Definition at line 148 of file ExtendedZoneSpecifier.h.

const ZoneMatch* ace_time::extended::Transition::match

The match which generated this Transition.

Definition at line 151 of file ExtendedZoneSpecifier.h.

DateTuple ace_time::extended::Transition::originalTransitionTime

If the transition is shifted to the beginning of a ZoneMatch, this is set to the transitionTime for debugging.

May be removed in the future.

Definition at line 202 of file ExtendedZoneSpecifier.h.

const extended::ZoneRule* ace_time::extended::Transition::rule

The Zone transition rule that matched for the the given year.

Set to nullptr if the RULES column is '-', indicating that the ZoneMatch was a "simple" ZoneEra.

Definition at line 158 of file ExtendedZoneSpecifier.h.

DateTuple ace_time::extended::Transition::startDateTime

Start time expressed using the UTC offset of the current Transition.

Valid after ExtendedZoneSpecifier::generateStartUntilTimes() is called.

Definition at line 180 of file ExtendedZoneSpecifier.h.

acetime_t ace_time::extended::Transition::startEpochSeconds

The calculated transition time of the given rule.

Definition at line 209 of file ExtendedZoneSpecifier.h.

DateTuple ace_time::extended::Transition::transitionTime

The original transition time, usually 'w' but sometimes 's' or 'u'.

After expandDateTuple() is called, this field will definitely be a 'w'. We must remember that the transitionTime* fields are expressed using the UTC offset of the previous Transition.

Definition at line 166 of file ExtendedZoneSpecifier.h.

DateTuple ace_time::extended::Transition::transitionTimeS

Version of transitionTime in 's' mode, using the UTC offset of the previous Transition.

Valid before ExtendedZoneSpecifier::generateStartUntilTimes() is called.

Definition at line 174 of file ExtendedZoneSpecifier.h.

DateTuple ace_time::extended::Transition::transitionTimeU

Version of transitionTime in 'u' mode, using the UTC offset of the previous transition.

Valid before ExtendedZoneSpecifier::generateStartUntilTimes() is called.

Definition at line 189 of file ExtendedZoneSpecifier.h.

DateTuple ace_time::extended::Transition::untilDateTime

Until time expressed using the UTC offset of the current Transition.

Valid after ExtendedZoneSpecifier::generateStartUntilTimes() is called.

Definition at line 195 of file ExtendedZoneSpecifier.h.


The documentation for this struct was generated from the following file: