home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR9 / WIZTOO.ZIP / SERVER.H < prev    next >
C/C++ Source or Header  |  1993-09-23  |  2KB  |  62 lines

  1. #ifndef _server_h_
  2. #define _server_h_
  3.  
  4. //  Module: SERVER.H
  5.  
  6. //  All of the servers defined in this module use their constructors
  7. //  to connect to register channels.  They use there destructors to
  8. //  disconnect from the register channels.
  9.  
  10. #include    <string.h>
  11. #include    "REGISTER.H"
  12. #include    "CHNNLDEF.H"
  13.  
  14. class Airport : public WindData, public AirData, public TornadoWarning
  15. {
  16.     char    caName[80];
  17. public:
  18.     Airport (const char *cpName)
  19.                            {strcpy(caName,cpName);
  20.                             oRegister.Connect((WindData *)this);
  21.                             oRegister.Connect((AirData *)this);
  22.                             oRegister.Connect((TornadoWarning *)this);
  23.                            }
  24.     ~Airport (void) {oRegister.Disconnect((WindData *)this);
  25.                      oRegister.Disconnect((AirData *)this);
  26.                      oRegister.Disconnect((TornadoWarning *)this);
  27.                     }
  28.     void ServeWindData (int iSpeed, int iDirection);
  29.     int  ServeAirData (int iTemperature,
  30.                        int iBarometricPressure,
  31.                        int iHumidity);
  32.     void ServeTornadoWarning (void);
  33. };                               
  34.  
  35. class FireDepartment : public WindData, public AirData, public TornadoWarning
  36. {
  37. public:
  38.     FireDepartment (void)  {oRegister.Connect((WindData *)this);
  39.                             oRegister.Connect((AirData *)this);
  40.                             oRegister.Connect((TornadoWarning *)this);
  41.                            }
  42.     ~FireDepartment (void) {oRegister.Disconnect((WindData *)this);
  43.                      oRegister.Disconnect((AirData *)this);
  44.                      oRegister.Disconnect((TornadoWarning *)this);
  45.                     }
  46.     void ServeWindData (int iSpeed, int iDirection);
  47.     int  ServeAirData (int iTemperature,
  48.                        int iBarometricPressure,
  49.                        int iHumidity);
  50.     void ServeTornadoWarning (void);
  51. };                               
  52.  
  53. class School : public TornadoWarning
  54. {
  55. public:
  56.     School (void) {oRegister.Connect((TornadoWarning *)this);}
  57.     ~School (void) {oRegister.Disconnect((TornadoWarning *)this);}
  58.     void ServeTornadoWarning (void);
  59. };
  60.  
  61. #endif
  62.