AceTime
3.0.0
Date and time classes for Arduino that support timezones from the TZ Database.
|
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 |
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:
Definition at line 38 of file TimeZoneData.h.