ML Reference
mlFieldSensor.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2007, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef ML_FIELD_SENSOR_H
14#define ML_FIELD_SENSOR_H
15
21
22//ML-includes
23#include "mlInitSystemML.h"
24
25ML_START_NAMESPACE
26
28class Field;
30
31//------------------------------------------------------------------------------------
37//------------------------------------------------------------------------------------
39{
40
41public:
42
47 };
48
54 FieldSensor(MLSensorCB* callbackFunction, void* userData);
55
57 virtual ~FieldSensor();
58
63 void callback(Strength notificationStrength=CHANGED);
64
68 void attachField(Field* field);
69
74
76 Field* getField() const;
77
83
84private:
85 friend class Field;
86
88 void attachFieldInternal(Field* field);
89
91 Field* _attachedField;
92
94 MLSensorCB* _callbackFunc;
95
97 void* _userData;
98
100 Strength _notificationStrength;
101};
102
103
104ML_END_NAMESPACE
105
106#endif // __mlFieldSensor_H
107
108
109
110
111
112
virtual ~FieldSensor()
Destructor: Disconnects field sensor from the connected field.
FieldSensor(MLSensorCB *callbackFunction, void *userData)
void attachField(Field *field)
void callback(Strength notificationStrength=CHANGED)
Strength getNotificationStrength() const
friend class Field
Strength
Enumeration type describing the strength of notifications.
@ CHANGED
Subject (i.e., the field) is notified and/or changed.
@ NO_NOTIFICATION
Default when sensor is asked outside a notification.
@ NO_CHANGE
Subject (i.e., the field) is notified but not changed.
Field * getField() const
Returns the field connected to the field sensor.
#define MLEXPORT
Code it as import symbol if compiled elsewhere.
void MLSensorCB(void *usrData, void *sensor)