home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR9
/
WIZTOO.ZIP
/
REGISTER.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-23
|
2KB
|
75 lines
// Module: REGISTER.CPP
#include <stdio.h>
#include "REGISTER.H"
#include "CHNNLDEF.H"
Register oRegister;
int Register::Connect (WindData *op) {
if (opWindDataChannel == NULL) {
opWindDataChannel = op;
return 1;
} else {
return 0;
}
}
int Register::Disconnect (WindData *op) {
if (opWindDataChannel == op) {
opWindDataChannel = NULL;
return 1;
} else {
return 0;
}
}
void Register::ExecuteWindData (int iSpeed, int iDirection) {
if (opWindDataChannel == NULL)
return;
((WindData *)opWindDataChannel)->ServeWindData(iSpeed, iDirection);
}
int Register::Connect (AirData *op) {
if (opAirDataChannel == NULL) {
opAirDataChannel = op;
return 1;
} else {
return 0;
}
}
int Register::Disconnect (AirData *op) {
if (opAirDataChannel == op) {
opAirDataChannel = NULL;
return 1;
} else {
return 0;
}
}
int Register::ExecuteAirData (int iTemperature,
int iBarometricPressure,
int iHumdity) {
if (opAirDataChannel == NULL)
return (int)1;
return ((AirData *)opAirDataChannel)->ServeAirData(iTemperature, iBarometricPressure, iHumdity);
}
int Register::Connect (TornadoWarning *op) {
if (opTornadoWarningChannel == NULL) {
opTornadoWarningChannel = op;
return 1;
} else {
return 0;
}
}
int Register::Disconnect (TornadoWarning *op) {
if (opTornadoWarningChannel == op) {
opTornadoWarningChannel = NULL;
return 1;
} else {
return 0;
}
}
void Register::ExecuteTornadoWarning (void) {
if (opTornadoWarningChannel == NULL)
return;
((TornadoWarning *)opTornadoWarningChannel)->ServeTornadoWarning();
}