semf
timebase.h
Go to the documentation of this file.
1
10#ifndef SEMF_SYSTEM_TIMEBASE_H_
11#define SEMF_SYSTEM_TIMEBASE_H_
12
17
18namespace semf
19{
23class TimeBase : public app::TimeBase
24{
25public:
31 explicit TimeBase(app::Timer& timer, bool enable = false);
32 explicit TimeBase(const TimeBase& other) = delete;
34 virtual ~TimeBase() = default;
36
41 void add(TickReceiver& tickReceiver) override;
46 void remove(TickReceiver& tickReceiver) override;
52 void enable(bool enable = true) override;
58 void disable(bool disable = true) override;
65 bool isEnabled() const override;
66
67private:
72 void count();
73
75 bool m_enabled;
77 app::Timer* m_timer;
79 SEMF_SLOT(m_countSlot, TimeBase, *this, count);
81 LinkedList<TickReceiver> m_tickReceiverList;
82};
83} /* namespace semf */
84#endif /* SEMF_SYSTEM_TIMEBASE_H_ */
LinkedList is an managed double linked list implementation.
Definition: linkedlist.h:43
Interface for all classes receiving ticks like DigitalInPolling or SoftwareTimer.
Definition: tickreceiver.h:29
A TimeBase is the bridge between e.g. a hardware timer (interrupt service routine) and TickReceiver o...
Definition: timebase.h:24
TimeBase(const TimeBase &other)=delete
void enable(bool enable=true) override
Enables the TimeBase.
Definition: timebase.cpp:32
void remove(TickReceiver &tickReceiver) override
Removes e.g. a timer from this TimeBase.
Definition: timebase.cpp:27
TimeBase(app::Timer &timer, bool enable=false)
Constructor.
Definition: timebase.cpp:15
void disable(bool disable=true) override
Disables the TimeBase.
Definition: timebase.cpp:37
void add(TickReceiver &tickReceiver) override
Adds e.g. a timer to this TimeBase.
Definition: timebase.cpp:22
bool isEnabled() const override
Returns if the TimeBase is enabled.
Definition: timebase.cpp:42
A TimeBase is the bridge between e.g. a hardware timer (interrupt service routine) and TickReceiver o...
Definition: timebase.h:36
virtual ~TimeBase()=default
Class for using timer hardware.
Definition: timer.h:24