Skip to content

Commit cad5940

Browse files
authored
Merge pull request #109 from bxparks/develop
merge 2.1.1 into master
2 parents 8344d21 + fdae4b2 commit cad5940

File tree

294 files changed

+1444
-845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+1444
-845
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Changelog
22

33
* Unreleased
4+
* 2.1.1 (2023-02-02, TZDB version 2022g)
5+
* `ZonedExtra`
6+
* Add `ZonedExtra::forComponents()` factory method, for consistency with
7+
`ZonedDateTime` class.
8+
* `examples/AutoBenchmark`
9+
* Add `ZonedExtra` benchmarks.
10+
* `README.md`
11+
* Update `AceTimeValidation` validation years to `[2000,2100)`.
12+
* Update memory and cpu benchmarks.
413
* 2.1.0 (2023-01-29, TZDB version 2022g)
514
* There are a handful API breaking changes in this release in the pursuit of
615
simpler and cleaner code. See the following for more info:

README.md

Lines changed: 117 additions & 97 deletions
Large diffs are not rendered by default.

USER_GUIDE.md

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ valid from the years `[2000,10000)`. By adjusting the `currentEpochYear()`, the
1818
library will work across any 100 year interval across the 8000 year range of the
1919
TZ database.
2020

21-
**Version**: 2.1.0 (2023-01-29, TZDB 2022g)
21+
**Version**: 2.1.1 (2023-02-02, TZDB 2022g)
2222

2323
**Related Documents**:
2424

@@ -1519,6 +1519,10 @@ class ZonedExtra {
15191519
static const uint8_t kTypeOverlap = 3;
15201520

15211521
static ZonedExtra forError();
1522+
static ZonedExtra forComponents(
1523+
int16_t year, uint8_t month, uint8_t day,
1524+
uint8_t hour, uint8_t minute, uint8_t second,
1525+
const TimeZone& tz, uint8_t fold = 0);
15221526
static ZonedExtra forEpochSeconds(
15231527
acetime_t epochSeconds, const TimeZone& tz);
15241528
static ZonedExtra forLocalDateTime(
@@ -1533,13 +1537,17 @@ class ZonedExtra {
15331537
int16_t reqDstOffsetMinutes,
15341538
const char* abbrev);
15351539

1536-
bool isError() const {
1537-
uint8_t type() const { return mType; }
1540+
bool isError() const;
1541+
uint8_t type() const;
15381542

1543+
TimeOffset timeOffset() const; // stdOffset + dstOffset
15391544
TimeOffset stdOffset() const;
15401545
TimeOffset dstOffset() const;
1546+
1547+
TimeOffset reqTimeOffset() const; // reqStdOffst + reqDstOffset
15411548
TimeOffset reqStdOffset() const;
15421549
TimeOffset reqDstOffset() const;
1550+
15431551
const char* abbrev() const;
15441552
};
15451553

@@ -1550,7 +1558,9 @@ The `ZonedExtra` instance is usually created through the 2 static factory
15501558
methods on the `ZonedExtra` class:
15511559
15521560
* `ZonedExtra::forEpochSeconds(epochSeconds, tz)`
1553-
* `ZonedExtra::forLocalDateTime(ldt, tz)`
1561+
* `ZonedExtra::forComponents(int16_t year, uint8_t month, uint8_t day,
1562+
uint8_t hour, uint8_t minute, uint8_t second, const TimeZone& tz,
1563+
uint8_t fold = 0)`
15541564
15551565
Often the `ZonedDateTime` will be created first from the epochSeconds, then the
15561566
`ZonedExtra` will be created to access additional information about the time zone at that particular epochSeconds (e.g. abbreviation):
@@ -1578,8 +1588,9 @@ The `ZonedExtra::dstOffset()` is the DST offset that pertains to the given
15781588
time instant. For example, for `America/Los_Angeles` this will return `01:00`
15791589
during summer DST, and `00:00` during normal times.
15801590

1581-
Note that the total UTC offset corresponding to `ZonedDateTime::timeOffset()` is
1582-
equal to `stdOffset() + dstOffset()`.
1591+
The `ZonedExtra::timeOffset()` is a convenience method that returns the sum of
1592+
`stdOffset() + dstOffset()`. This value is identical to the total UTC offset
1593+
returned by `ZonedDateTime::timeOffset()`.
15831594

15841595
The `ZonedExtra::abbrev()` is the short abbreviation that is in effect at the
15851596
given time instant. For example, for `America/Los_Angeles`, this returns "PST"
@@ -1589,8 +1600,8 @@ the life of the `ZonedExtra` object.
15891600

15901601
The `ZonedExtra::reqStdOffset()` and `ZonedExtra::reqDstOffset()` are relevant
15911602
and different from the corresponding `stdOffset()` and `dstOffset()` only if the
1592-
`type()` is `kTypeGap`. This occurs only if the `getZonedExtra(LocalDateTime&)`
1593-
overloaded version is used. Following the algorithm described in [Python PEP
1603+
`type()` is `kTypeGap`. This occurs only if the `ZonedExtra::forComponents()`
1604+
factory method is used. Following the algorithm described in [Python PEP
15941605
495](https://www.python.org/dev/peps/pep-0495/), the provided localDateTime is
15951606
imaginary during a gap so must be mapped to a real local time using the
15961607
`LocalDateTime::fold` parameter. When `fold=0`, the transition line before the
@@ -1788,8 +1799,8 @@ zone name:
17881799
```C++
17891800
ExtendedZoneProcessorCache<CACHE_SIZE> zoneProcessorCache;
17901801
ExtendedZoneManager zoneManager(
1791-
zonedbx::kZoneRegistrySize,
1792-
zonedbx::kZoneRegistry,
1802+
zonedbx::kZoneAndLinkRegistrySize,
1803+
zonedbx::kZoneAndLinkRegistry,
17931804
zoneProcessorCache);
17941805
17951806
void someFunction() {
@@ -1807,8 +1818,8 @@ could be done more efficiently using the `createForZoneInfo()` like this:
18071818
```C++
18081819
ExtendedZoneProcessorCache<CACHE_SIZE> zoneProcessorCache;
18091820
ExtendedZoneManager zoneManager(
1810-
zonedbx::kZoneRegistrySize,
1811-
zonedbx::kZoneRegistry,
1821+
zonedbx::kZoneAndLinkRegistrySize,
1822+
zonedbx::kZoneAndLinkRegistry,
18121823
zoneProcessorCache);
18131824

18141825
void someFunction() {
@@ -1844,8 +1855,8 @@ corresponding to the given `zoneId`:
18441855
```C++
18451856
ExtendedZoneProcessorCache<CACHE_SIZE> zoneProcessorCache;
18461857
ExtendedZoneManager zoneManager(
1847-
zonedbx::kZoneRegistrySize,
1848-
zonedbx::kZoneRegistry,
1858+
zonedbx::kZoneAndLinkRegistrySize,
1859+
zonedbx::kZoneAndLinkRegistry,
18491860
zoneProcessorCache);
18501861
18511862
void someFunction() {
@@ -2207,8 +2218,8 @@ Here are some examples taken from
22072218
```C++
22082219
ExtendedZoneProcessorCache<1> zoneProcessorCache;
22092220
ExtendedZoneManager extendedZoneManager(
2210-
zonedbx::kZoneRegistrySize,
2211-
zonedbx::kZoneRegistry,
2221+
zonedbx::kZoneAndLinkRegistrySize,
2222+
zonedbx::kZoneAndLinkRegistry,
22122223
zoneProcessorCache);
22132224
TimeZone tz = extendedZoneManager.createForZoneInfo(
22142225
&zonedbx::kZoneAmerica_Los_Angeles);
@@ -2517,9 +2528,12 @@ canonical entry (e.g. `US/Pacific` which points to `America/Los_Angeles`).
25172528
Prior to v2.1, AceTime treated Links slightly differently than Zones, providing
25182529
4 different implementations over several version. After v2.1, Links are
25192530
considered to be identical to Zones, because the TZDB considers both of them to
2520-
be first-class citizens. Following this merger, the `kZoneAndLinkRegistry` has
2521-
been merged into the `kZoneRegistry` and the 2 registries are identical.
2531+
be first-class citizens. For most 32-bit processors with enough flash memory,
2532+
the `kZoneAndLinkRegistry` should be used. The `kZoneRegistry` containing
2533+
only the Zone entries is maintained mostly for backwards compatibility and
2534+
testing purposes.
25222535
2536+
Most methods on the `TimeZone` class apply to both Zone and Link time zones.
25232537
There are 2 methods on the `TimeZone` class which apply only to Links:
25242538
25252539
```C++
@@ -2546,10 +2560,10 @@ the time zone `US/Pacific` (which is a Link to `America/Los_Angeles`):
25462560
#### Custom Zone Registry
25472561
25482562
On small microcontrollers, the default zone registries (`kZoneRegistry` and
2549-
`kZoneAndLinkRegistry`, which are now identical) may be too large. The
2550-
`ZoneManager` can be configured with a custom zone registry. It needs to be
2551-
given an array of `ZoneInfo` pointers when constructed. For example, here is a
2552-
`BasicZoneManager` with only 4 zones from the `zonedb::` data set:
2563+
`kZoneAndLinkRegistry`) may be too large. The `ZoneManager` can be configured
2564+
with a custom zone registry. It needs to be given an array of `ZoneInfo`
2565+
pointers when constructed. For example, here is a `BasicZoneManager` with only 4
2566+
zones from the `zonedb::` data set:
25532567
25542568
```C++
25552569
#include <AceTime.h>

docs/doxygen.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = AceTime
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 2.1.0
41+
PROJECT_NUMBER = 2.1.1
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

docs/html/AceTime_8h_source.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<tr style="height: 56px;">
2323
<td id="projectalign" style="padding-left: 0.5em;">
2424
<div id="projectname">AceTime
25-
&#160;<span id="projectnumber">2.1.0</span>
25+
&#160;<span id="projectnumber">2.1.1</span>
2626
</div>
2727
<div id="projectbrief">Date and time classes for Arduino that support timezones from the TZ Database.</div>
2828
</td>
@@ -128,8 +128,8 @@
128128
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;<span class="preprocessor">#include &quot;ace_time/ace_time_utils.h&quot;</span></div>
129129
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
130130
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="comment">// Version format: xxyyzz == &quot;xx.yy.zz&quot;</span></div>
131-
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="preprocessor">#define ACE_TIME_VERSION 20100</span></div>
132-
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor">#define ACE_TIME_VERSION_STRING &quot;2.1.0&quot;</span></div>
131+
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="preprocessor">#define ACE_TIME_VERSION 20101</span></div>
132+
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="preprocessor">#define ACE_TIME_VERSION_STRING &quot;2.1.1&quot;</span></div>
133133
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; </div>
134134
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="preprocessor">#endif</span></div>
135135
<div class="ttc" id="acommon_2common_8h_html"><div class="ttname"><a href="common_2common_8h.html">common.h</a></div><div class="ttdoc">Identifiers used by implementation code which need to be publically exported.</div></div>

docs/html/BasicBrokers_8cpp_source.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<tr style="height: 56px;">
2323
<td id="projectalign" style="padding-left: 0.5em;">
2424
<div id="projectname">AceTime
25-
&#160;<span id="projectnumber">2.1.0</span>
25+
&#160;<span id="projectnumber">2.1.1</span>
2626
</div>
2727
<div id="projectbrief">Date and time classes for Arduino that support timezones from the TZ Database.</div>
2828
</td>

docs/html/BasicBrokers_8h.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<tr style="height: 56px;">
2323
<td id="projectalign" style="padding-left: 0.5em;">
2424
<div id="projectname">AceTime
25-
&#160;<span id="projectnumber">2.1.0</span>
25+
&#160;<span id="projectnumber">2.1.1</span>
2626
</div>
2727
<div id="projectbrief">Date and time classes for Arduino that support timezones from the TZ Database.</div>
2828
</td>

docs/html/BasicBrokers_8h_source.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<tr style="height: 56px;">
2323
<td id="projectalign" style="padding-left: 0.5em;">
2424
<div id="projectname">AceTime
25-
&#160;<span id="projectnumber">2.1.0</span>
25+
&#160;<span id="projectnumber">2.1.1</span>
2626
</div>
2727
<div id="projectbrief">Date and time classes for Arduino that support timezones from the TZ Database.</div>
2828
</td>

docs/html/BasicZoneProcessor_8h_source.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<tr style="height: 56px;">
2323
<td id="projectalign" style="padding-left: 0.5em;">
2424
<div id="projectname">AceTime
25-
&#160;<span id="projectnumber">2.1.0</span>
25+
&#160;<span id="projectnumber">2.1.1</span>
2626
</div>
2727
<div id="projectbrief">Date and time classes for Arduino that support timezones from the TZ Database.</div>
2828
</td>

docs/html/BasicZone_8cpp_source.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<tr style="height: 56px;">
2323
<td id="projectalign" style="padding-left: 0.5em;">
2424
<div id="projectname">AceTime
25-
&#160;<span id="projectnumber">2.1.0</span>
25+
&#160;<span id="projectnumber">2.1.1</span>
2626
</div>
2727
<div id="projectbrief">Date and time classes for Arduino that support timezones from the TZ Database.</div>
2828
</td>

0 commit comments

Comments
 (0)