home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR9 / WIZTOO.ZIP / BRDCASTR.CPP < prev    next >
C/C++ Source or Header  |  1993-09-22  |  1KB  |  47 lines

  1. //  Module: BRDCASTR.CPP
  2.  
  3. #include <stdio.h>
  4. #include "BRDCASTR.H"
  5. #include "CHNNLDEF.H"
  6.  
  7.     Broadcaster oBroadcaster;
  8.  
  9. int Broadcaster::Connect (WindData *op) {
  10.     return oWindDataChannel.Add(op); }
  11. int Broadcaster::Disconnect (WindData *op) {
  12.     return oWindDataChannel.Delete(op); }
  13. void Broadcaster::BroadcastWindData (int iSpeed, int iDirection) {
  14.     for (void *op = oWindDataChannel.First();
  15.          op != NULL;
  16.          op = oWindDataChannel.Next())
  17.     {
  18.         ((WindData *)op)->ReceiveWindData(iSpeed, iDirection);
  19.     }
  20. }
  21. int Broadcaster::Connect (AirData *op) {
  22.     return oAirDataChannel.Add(op); }
  23. int Broadcaster::Disconnect (AirData *op) {
  24.     return oAirDataChannel.Delete(op); }
  25. void Broadcaster::BroadcastAirData (int iTemperature,
  26.          int iBarometricPressure,
  27.          int iHumdity) {
  28.     for (void *op = oAirDataChannel.First();
  29.          op != NULL;
  30.          op = oAirDataChannel.Next())
  31.     {
  32.         ((AirData *)op)->ReceiveAirData(iTemperature, iBarometricPressure, iHumdity);
  33.     }
  34. }
  35. int Broadcaster::Connect (TornadoWarning *op) {
  36.     return oTornadoWarningChannel.Add(op); }
  37. int Broadcaster::Disconnect (TornadoWarning *op) {
  38.     return oTornadoWarningChannel.Delete(op); }
  39. void Broadcaster::BroadcastTornadoWarning (void) {
  40.     for (void *op = oTornadoWarningChannel.First();
  41.          op != NULL;
  42.          op = oTornadoWarningChannel.Next())
  43.     {
  44.         ((TornadoWarning *)op)->ReceiveTornadoWarning();
  45.     }
  46. }
  47.