AceTime 3.0.0 Date and time classes for Arduino that support timezones from the TZ Database.

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ace_time::TimeZoneData Struct Reference

Data structure that captures the internal state of a TimeZone object with enough information so that it can be serialized using TimeZone::toTimeZoneData() then reconstructed using ZoneManager::createForTimeZoneData(). More...

`#include <TimeZoneData.h>`

## Public Member Functions
| TimeZoneData (uint32_t zid)
| Constructor for kTypeZoneId needed because C+11 does not have member initialization, and cannot initialize the 'zoneId' component of the union.
| TimeZoneData (int16_t stdMinutes, int16_t dstMinutes)
| Constructor for kTypeManual.
| TimeZoneData ()
| Default constructor gives kTypeError sentinel.

## Public Attributes
uint8_t | type
union {
struct {
int16_t stdOffsetMinutes
int16_t dstOffsetMinutes
} |
| Used for kTypeManual. More...
uint32_t zoneId
| Both TimeZone::kTypeBasic and TimeZone::kTypeExtended are mapped to a TimeZoneData::kTypeZoneId.
}; |

## Static Public Attributes
static const uint8_t | kTypeError = 0
static const uint8_t | kTypeManual = 1
static const uint8_t | kTypeZoneId = 2

## Detailed Description

Data structure that captures the internal state of a TimeZone object with enough information so that it can be serialized using TimeZone::toTimeZoneData() then reconstructed using ZoneManager::createForTimeZoneData().

This data structure is meant to a simple and somewhat opaque serialization object. You should not rely on this struct to remain stable, nor reach into its internal fields. No versioning is provided for simplicity. If the internal format changes in the future, the previous version will likely be incompatible with the new version of the library. It is recommended to use a CRC check to detect version incompatibility if this data structure is saved (e.g. EEPROM) and retrieved later .

For convenience, an array of TimeZoneData can be initializeed using the usual initializer syntax. In other words, the following is allowed:

TimeZoneData zones[3] = {
{0, 0},
{zonedb::kZoneIdAmerica_Los_Angeles},
{}
};
ace_time::TimeZoneData::TimeZoneData
TimeZoneData()
Default constructor gives kTypeError sentinel.
Definition: TimeZoneData.h:60

Definition at line 38 of file TimeZoneData.h.

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

- /home/brian/src/AceTimeSuite/libraries/AceTimeLib/src/ace_time/TimeZoneData.h