Class Bell

Class Bell

Placement in the overall structure

Module
meeting
Base classes
Chain
Derived classes
Buzzer
Time of creation
Task 6
Files
bell.h

Description

Bell is an abstract base class that allows the time-controlled triggering of an activity. For this purpose, it has an internal counter that is managed by the Bellringer.

Public methods

void wait (int value)
int wait ()
Set or get the counter.
void tick ()
Decrements the counter.
bool run_down()
Returns true, when the time has expired.
virtual void ring () = 0
Called by the bell ringer when it is the right time.

Notes

In order to use Bell, a derived class must be created in which the ring() method is defined.

All other methods are best defined as inline.