AceTime  1.7.4
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.
BasicZone.h
1 /*
2  * MIT License
3  * Copyright (c) 2019 Brian T. Park
4  */
5 
6 #ifndef ACE_TIME_BASIC_ZONE_H
7 #define ACE_TIME_BASIC_ZONE_H
8 
9 #include "internal/ZoneInfo.h"
10 #include "internal/BasicBrokers.h"
11 
12 class Print;
13 
14 namespace ace_time {
15 
21 class BasicZone {
22  public:
27  BasicZone(const basic::ZoneInfo* zoneInfo):
28  mZoneInfoBroker(zoneInfo) {}
29 
35  BasicZone(const basic::ZoneInfoBroker& zoneInfo):
36  mZoneInfoBroker(zoneInfo) {}
37 
39  void printNameTo(Print& printer) const;
40 
46  void printShortNameTo(Print& printer) const;
47 
49  uint32_t zoneId() const {
50  return mZoneInfoBroker.zoneId();
51  }
52 
53  private:
54  // disable default copy constructor and assignment operator
55  BasicZone(const BasicZone&) = delete;
56  BasicZone& operator=(const BasicZone&) = delete;
57 
58  const basic::ZoneInfoBroker mZoneInfoBroker;
59 };
60 
61 }
62 
63 #endif
ace_time::BasicZone::BasicZone
BasicZone(const basic::ZoneInfoBroker &zoneInfo)
Constructor from a basic::ZoneInfoBroker, used by BasicZoneProcessor.
Definition: BasicZone.h:35
ace_time::BasicZone::printNameTo
void printNameTo(Print &printer) const
Print the full zone name to printer.
Definition: BasicZone.cpp:20
BasicBrokers.h
ace_time::BasicZone::printShortNameTo
void printShortNameTo(Print &printer) const
Print the short pretty zone name to the printer.
Definition: BasicZone.cpp:27
ace_time::BasicZone
A thin wrapper around a basic::ZoneInfo data structure to provide a stable API access to some useful ...
Definition: BasicZone.h:21
ace_time::basic::ZoneInfoBroker
Data broker for accessing ZoneInfo.
Definition: BasicBrokers.h:286
ace_time::BasicZone::zoneId
uint32_t zoneId() const
Return the zoneId of the current zoneInfo.
Definition: BasicZone.h:49
ace_time::BasicZone::BasicZone
BasicZone(const basic::ZoneInfo *zoneInfo)
Constructor from a raw basic::ZoneInfo* pointer, intended for manual inspection of a ZoneInfo record.
Definition: BasicZone.h:27