GUIModelSubscriber.h
Go to the documentation of this file.
1 #ifndef OM_GUIMODELSUBSCRIBER_H
2 #define OM_GUIMODELSUBSCRIBER_H
3 namespace om { class GUIModelData; }
4 
5 namespace om
6 {
7  ///
8  /// Any class which needs to be informated about state changes in
9  /// the GUIModel
10  ///
12  {
13  public:
14  ///
15  /// Create a GUIModel subscriber.
16  ///
17  /// \param which - bit set indicating which messages we want
18  ///
19  /// See GUIModelData for the list of possibilities
20  ///
21  GUIModelSubscriber(unsigned int which);
23 
24  bool GetLock();
25  void ReleaseLock();
26 
27  ///
28  /// Receive notifications when the GUI model data has changed
29  ///
30  /// \param m - The new model data
31  /// \param which - Which element of the data has changed
32  ///
33  /// See GUIModel.h for the definitions of "which".
34  ///
35  /// Note: To prevent collisions between threads, users should
36  /// implement their "GUIModelDataIssue" methods following this
37  /// pattern:
38  ///
39  /// {
40  /// book aok = this->GetLock();
41  /// if (!aok) return;
42  ///
43  /// ...your code here...
44  ///
45  /// this->ReleaseLock();
46  /// }
47  ///
48  virtual void GUIModelDataIssue(const GUIModelData& m,
49  unsigned int which) = 0;
50  };
51 }
52 #endif
53 ////////////////////////////////////////////////////////////////////////
GUIModelSubscriber(unsigned int which)
virtual void GUIModelDataIssue(const GUIModelData &m, unsigned int which)=0
Online Monitoring package header.