AceTime  1.3
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
Public Member Functions | Protected Member Functions | List of all members
ace_time::ZoneManagerImpl< ZI, ZR, ZSC > Class Template Reference

A templatized implementation of ZoneManager that binds the (Basic|Extended)ZoneRegistrar with the corresponding (Basic|Extended)ZoneProcessorCache. More...

#include <ZoneManager.h>

Public Member Functions

TimeZone createForZoneName (const char *name) override
 
TimeZone createForZoneId (uint32_t id) override
 
TimeZone createForZoneIndex (uint16_t index) override
 
TimeZone createForTimeZoneData (const TimeZoneData &d) override
 
uint16_t indexForZoneName (const char *name) const override
 
uint16_t indexForZoneId (uint32_t id) const override
 
uint16_t registrySize () const override
 
TimeZone createForZoneInfo (const ZI *zoneInfo)
 Create a TimeZone from an explicit ZoneInfo reference. More...
 

Protected Member Functions

 ZoneManagerImpl (uint16_t registrySize, const ZI *const *zoneRegistry)
 Constructor. More...
 

Detailed Description

template<typename ZI, typename ZR, typename ZSC>
class ace_time::ZoneManagerImpl< ZI, ZR, ZSC >

A templatized implementation of ZoneManager that binds the (Basic|Extended)ZoneRegistrar with the corresponding (Basic|Extended)ZoneProcessorCache.

Applications will normally use two specific instantiation of this class: BasicZoneManager<SIZE> and ExtendedZoneManager<SIZE>.

If an entry in the ZoneRegistrar is not found, then TimeZone::forError() will be returned.

If a ZoneProcessor exists in the ZoneProcessorCache that is already bound to the given TimeZone, then the ZoneProcessor is reused. If not, another ZoneProcessor is picked from the cache in a round-robin fashion (kicking off the previously bound TimeZone). The type of the TimeZone will be assigned to be the type of the ZoneProcessorCache, which will be either kTypeBasicManaged or kTypeExtendedManaged.

Template Parameters
ZItype of ZoneInfo (basic::ZoneInfo or extended::ZoneInfo) which make up the zone registry
ZRclass of ZoneRegistrar which holds the registry of ZoneInfo
ZSCclass of ZoneProcessorCache

Definition at line 23 of file TimeZone.h.

Constructor & Destructor Documentation

◆ ZoneManagerImpl()

template<typename ZI , typename ZR , typename ZSC >
ace_time::ZoneManagerImpl< ZI, ZR, ZSC >::ZoneManagerImpl ( uint16_t  registrySize,
const ZI *const *  zoneRegistry 
)
inlineprotected

Constructor.

Parameters
registrySizenumber of ZoneInfo entries in the registry
zoneRegistryan array of ZoneInfo entries

Definition at line 202 of file ZoneManager.h.

Member Function Documentation

◆ createForZoneInfo()

template<typename ZI , typename ZR , typename ZSC >
TimeZone ace_time::ZoneManagerImpl< ZI, ZR, ZSC >::createForZoneInfo ( const ZI *  zoneInfo)
inline

Create a TimeZone from an explicit ZoneInfo reference.

The ZoneRegistrar will be bypassed because the ZoneInfo is already available, but the TimeZone will reuse the ZoneProcessorCache. This is expected to be used mostly in tests, but it could be useful for applications.

Definition at line 190 of file ZoneManager.h.


The documentation for this class was generated from the following files: