////////////////////////////////////////////////////////////////////////////
// Notify light switch observers of a change in the switch state.
// The parameter is true if ON is being requested (pushing the top of the
// switch), false if OFF is being requested (pushing the bottom).
void LightSwitch::notifyClients (bool state)
{
// Loop to notify all clients...
LightSwitchObserver* observer;
for (observer = getFirstObserver();
observer;
observer = getNextObserver())
{
observer->lightSwitchChange (state, this);
}
}
Previous slide | Next slide | Back to first slide | View graphic version |