NewBie question : call back function.
Posted on 1998-07-11
From the example of Booch's book :
Object Oriented Analysis and Design with Application (p.45,46)
There are two similar classes :
e.g. 1 :
typedef float temperature;
typedef unsigned int location;
void calibrate(temperature actual temperature);
temperature currenttemperature() const;
e.g. 2 :
activetemperaturesensor(location,void (*f) (location, temperature));
void calibrate(temperature actualtemperature);
void establishsetpoint(temperature setpoint, temperature delta);
temperature currenttemperature() const ;
The second one has a callback function and is so called a
more 'active' class.
(the first one is called a 'passive' one.)
Can someone explain it more detail?