Class Bellringer

Class Bellringer

Placement in the overall structure

Module
meeting
Base classes
List
Derived classes
None
Time of creation
Task 6
Files
bellringer.h and bellringer.cc

Description

The "bell ringer" (Bellringer) is activated periodically and checks if any "bells" (Bell objects) need to ring. The bells are in a list that the bellringer manages.

Public methods

void check ()
Checks whether bells are to be rung and does so if necessary.
void job (Bell *bell, int ticks)
The bell is given to the bell ringer. It should be rung after ticks time units.
void cancel (Bell *bell)
The bell should not be rung after all.

Notes

The check() method must of course be called regularly from the timer epilog (Watch) so that the bell ringer can work accurately. Therefore, also think a bit about how the bell ringer can manage the bells (Bell objects) (and the times at which they have to be activated) in a way that check() can be implemented efficiently!