ML Reference
|
00001 // **InsertLicense** code 00002 //------------------------------------------------------------------------------------ 00013 //------------------------------------------------------------------------------------ 00014 #ifndef __mlFieldSensor_H 00015 #define __mlFieldSensor_H 00016 00017 //ML-includes 00018 #ifndef __mlInitSystemML_H 00019 #include "mlInitSystemML.h" 00020 #endif 00021 00022 ML_START_NAMESPACE 00023 00025 class Field; 00027 00028 //------------------------------------------------------------------------------------ 00034 //------------------------------------------------------------------------------------ 00035 class MLEXPORT FieldSensor 00036 { 00037 00038 public: 00039 00041 enum Strength { NO_NOTIFICATION = 0, 00042 NO_CHANGE = 1, 00043 CHANGED = 2 00044 }; 00045 00051 FieldSensor(MLSensorCB* callbackFunction, void* userData); 00052 00054 virtual ~FieldSensor(); 00055 00060 void callback(Strength notificationStrength=CHANGED); 00061 00065 void attachField(Field* field); 00066 00070 void detachField(); 00071 00073 Field* getField() const; 00074 00080 Strength getNotificationStrength() const; 00081 00082 private: 00083 friend class Field; 00084 00086 void attachFieldInternal(Field* field); 00087 00089 Field* _attachedField; 00090 00092 MLSensorCB* _callbackFunc; 00093 00095 void* _userData; 00096 00098 Strength _notificationStrength; 00099 }; 00100 00101 00102 ML_END_NAMESPACE 00103 00104 #endif // __mlFieldSensor_H 00105 00106 00107 00108 00109 00110