Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
1.6 KiB

  1. /*
  2. *
  3. * NOTES:
  4. *
  5. * REVISIONS:
  6. * ker13NOV92 Initial OS/2 Revision
  7. * pcy07Dec92: DeepGet no longer needs aCode
  8. * pcy11Dec92: Rework
  9. * cad31Aug93: removing compiler warnings (some anyway)
  10. * pcy08Apr94: Trim size, use static iterators, dead code removal
  11. * awm27Oct97: Added performance monitor offset to sensor class
  12. * awm14Jan98: Removed performance monitor offset -- this exists in own class now
  13. * clk11Feb98: Added DeepGetWithoutUpdate function
  14. */
  15. #ifndef __SENSOR_H
  16. #define __SENSOR_H
  17. #include "cdefine.h"
  18. #include "_defs.h"
  19. #include "codes.h"
  20. #include "err.h"
  21. #include "apc.h"
  22. #include "update.h"
  23. _CLASSDEF(CommController)
  24. _CLASSDEF(Device)
  25. _CLASSDEF(Event)
  26. _CLASSDEF(Sensor)
  27. #define NO_SENSOR_CODE 666
  28. enum ACCESSTYPE { AREAD_ONLY, AREAD_WRITE };
  29. class Sensor : public UpdateObj {
  30. protected:
  31. PDevice theDevice;
  32. PCommController theCommController;
  33. INT theSensorCode;
  34. ACCESSTYPE readOnly;
  35. PCHAR theValue;
  36. virtual INT storeValue(const PCHAR aValue);
  37. PCHAR lookupSensorName(INT anIsaCode);
  38. public:
  39. Sensor( PDevice aParent, PCommController aCommController, INT aSensorCode, ACCESSTYPE aReadOnly = AREAD_ONLY);
  40. virtual ~Sensor();
  41. //overidden interfaces
  42. virtual INT Update(PEvent anEvent);
  43. //additional public interfaces
  44. virtual INT Get(PCHAR);
  45. virtual INT Get(INT, PCHAR);
  46. virtual INT DeepGet(PCHAR = (PCHAR)NULL);
  47. virtual INT DeepGetWithoutUpdate(PCHAR = NULL);
  48. virtual INT Set(const PCHAR);
  49. virtual INT Set(INT, const PCHAR);
  50. virtual INT Validate(INT, const PCHAR) { return ErrNO_ERROR; } ;
  51. };
  52. #endif