Design Patterns
clock_timer.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_CLOCK_TIMER_H_
7 #define OPERATIONAL_OBSERVER_CLOCK_TIMER_H_
8 
9 #include "clock_tick_observer.h"
10 #include "clock_tick.h"
11 
12 namespace operational
13 {
14 namespace observer
15 {
17 {
18  public:
19  ClockTimer();
20 
21  virtual ~ClockTimer();
22 
23  virtual int GetHours();
24  virtual int GetMinutes();
25  virtual int GetSeconds();
26 
27  void Tick();
28 
29  void Attach(ClockTickObserver* observer_interface) const;
30  void Detach(ClockTickObserver* observer_interface) const;
31 
32  private:
33  int hours_;
34  int minutes_;
35  int seconds_;
36 
37  ClockTick* clock_tick_;
38 };
39 }
40 }
41 
42 #endif
43 
void Attach(ClockTickObserver *observer_interface) const
Definition: clock_timer.cc:50
void Tick()
Definition: clock_timer.cc:34
void Detach(ClockTickObserver *observer_interface) const
Definition: clock_timer.cc:55
Definition: clock_tick_observer.h:13
Definition: clock_timer.h:16
Definition: clock_tick.h:18
Definition: application.cc:10
virtual int GetSeconds()
Definition: clock_timer.cc:29
virtual ~ClockTimer()
Definition: clock_timer.cc:17
virtual int GetMinutes()
Definition: clock_timer.cc:24
virtual int GetHours()
Definition: clock_timer.cc:19
ClockTimer()
Definition: clock_timer.cc:12