AceTime  2.2.0
Date and time classes for Arduino that support timezones from the TZ Database.
Classes | Typedefs
Brokers.h File Reference

These classes provide a thin layer of indirection for accessing the zoneinfo files stored in the zonedb/ and zonedbx/ directories. More...

#include <stdint.h>
#include <AceCommon.h>
#include "compat.h"
#include "BrokerCommon.h"
#include "ZoneContext.h"
#include "ZoneInfo.h"
Include dependency graph for Brokers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ace_time::internal::ZoneRuleBroker< ZR >
 Data broker for accessing ZoneRule. More...
 
class  ace_time::internal::ZonePolicyBroker< ZP, ZR >
 Data broker for accessing ZonePolicy. More...
 
class  ace_time::internal::ZoneEraBroker< ZE, ZP, ZR >
 Data broker for accessing ZoneEra. More...
 
class  ace_time::internal::ZoneInfoBroker< ZI, ZE, ZP, ZR >
 Data broker for accessing ZoneInfo. More...
 
class  ace_time::internal::ZoneRegistryBroker< ZI >
 Data broker for accessing the ZoneRegistry. More...
 
class  ace_time::internal::BrokerFactory< ZI, ZE, ZP, ZR >
 A factory that creates an ZoneInfoBroker. More...
 

Typedefs

using ace_time::basic::ZoneRuleBroker = internal::ZoneRuleBroker< ZoneRule >
 Data broker for accessing ZoneRule.
 
using ace_time::basic::ZonePolicyBroker = internal::ZonePolicyBroker< ZonePolicy, ZoneRule >
 Data broker for accessing ZonePolicy.
 
using ace_time::basic::ZoneEraBroker = internal::ZoneEraBroker< ZoneEra, ZonePolicy, ZoneRule >
 Data broker for accessing ZoneEra.
 
using ace_time::basic::ZoneInfoBroker = internal::ZoneInfoBroker< ZoneInfo, ZoneEra, ZonePolicy, ZoneRule >
 Data broker for accessing ZoneInfo.
 
using ace_time::basic::ZoneRegistryBroker = internal::ZoneRegistryBroker< ZoneInfo >
 Data broker for accessing the ZoneRegistry. More...
 
using ace_time::basic::BrokerFactory = internal::BrokerFactory< ZoneInfo, ZoneEra, ZonePolicy, ZoneRule >
 
using ace_time::extended::ZoneRuleBroker = internal::ZoneRuleBroker< ZoneRule >
 Data broker for accessing ZoneRule.
 
using ace_time::extended::ZonePolicyBroker = internal::ZonePolicyBroker< ZonePolicy, ZoneRule >
 Data broker for accessing ZonePolicy.
 
using ace_time::extended::ZoneEraBroker = internal::ZoneEraBroker< ZoneEra, ZonePolicy, ZoneRule >
 Data broker for accessing ZoneEra.
 
using ace_time::extended::ZoneInfoBroker = internal::ZoneInfoBroker< ZoneInfo, ZoneEra, ZonePolicy, ZoneRule >
 Data broker for accessing ZoneInfo.
 
using ace_time::extended::ZoneRegistryBroker = internal::ZoneRegistryBroker< ZoneInfo >
 Data broker for accessing the ZoneRegistry. More...
 
using ace_time::extended::BrokerFactory = internal::BrokerFactory< ZoneInfo, ZoneEra, ZonePolicy, ZoneRule >
 

Detailed Description

These classes provide a thin layer of indirection for accessing the zoneinfo files stored in the zonedb/ and zonedbx/ directories.

When ACE_TIME_USE_PROGMEM is enabled, the zoneinfo files are stored in flash memory (using the PROGMEM keyword), and cannot be accessed directly on microcontrollers using the Harvard architecture (e.g. AVR) where data and program live in 2 different address spaces. The data in flash memory must be accessed using helper routines in <pgmspace.h>. These classes abstract away this difference so that the code BasicZoneProcessor and ExtendedZoneProcessor can be written to be (mostly) agnostic to how the zoneinfo files are stored.

When ACE_TIME_USE_PROGMEM is disabled, the compiler will optimize away this entire abstraction layer, so the resulting machine code is no bigger than (and in most cases, identical to) accessing the zoneinfo files directly.

The abstraction layer is thin enough that the code in BasicZoneProcessor and ExtendedZoneProcessor did not change very much. It was mostly a mechanical source code replacement of direct zoneinfo access to using these data brokers.

The brokers in the basic:: and extended:: namespaces are identical in code. The purpose for having separate class hierarchies is to provide compile-time assurance that the BasicZoneProcessor and ExtendedZoneProcessor are given the correct zoneinfo files from the appropriate zonedb database.

Definition in file Brokers.h.

Typedef Documentation

◆ ZoneRegistryBroker [1/2]

using ace_time::basic::ZoneRegistryBroker = typedef internal::ZoneRegistryBroker<ZoneInfo>

Data broker for accessing the ZoneRegistry.

The ZoneRegistry is an array of (const ZoneInfo*) in the zone_registry.cpp file.

Definition at line 515 of file Brokers.h.

◆ ZoneRegistryBroker [2/2]

using ace_time::extended::ZoneRegistryBroker = typedef internal::ZoneRegistryBroker<ZoneInfo>

Data broker for accessing the ZoneRegistry.

The ZoneRegistry is an array of (const ZoneInfo*) in the zone_registry.cpp file.

Definition at line 543 of file Brokers.h.