Design Patterns
digital_clock.h
Go to the documentation of this file.
1 // Based on "Design Patterns: Elements of Reusable Object-Oriented Software"
2 // book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm
3 //
4 // Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.
5 
6 #ifndef OPERATIONAL_OBSERVER_DIGITAL_CLOCK_H_
7 #define OPERATIONAL_OBSERVER_DIGITAL_CLOCK_H_
8 
10 #include "clock_timer.h"
11 
12 #include <string>
13 
14 namespace operational
15 {
16 namespace observer
17 {
19 {
20  public:
21  explicit DigitalClock(ClockTimer* clock_timer);
22  virtual ~DigitalClock() override;
23 
24  virtual void OnClockTick() override;
25 
26  virtual void Draw() override;
27 
28  std::string formated_time() const;
29 
30  private:
31  ClockTimer* clock_timer_;
32  std::string formated_time_;
33 };
34 }
35 }
36 
37 #endif
38 
Definition: clock_tick_observer.h:13
Definition: clock_timer.h:16
virtual ~DigitalClock() override
Definition: digital_clock.cc:19
Definition: application.cc:10
virtual void OnClockTick() override
Definition: digital_clock.cc:24
std::string formated_time() const
Definition: digital_clock.cc:41
Definition: digital_clock.h:18
DigitalClock(ClockTimer *clock_timer)
Definition: digital_clock.cc:14
Definition: observer_widget_interface.h:13
virtual void Draw() override
Definition: digital_clock.cc:29