Public Member Functions | |
GUIModelSubscriber (unsigned int which) | |
~GUIModelSubscriber () | |
bool | GetLock () |
void | ReleaseLock () |
virtual void | GUIModelDataIssue (const GUIModelData &m, unsigned int which)=0 |
Any class which needs to be informated about state changes in the GUIModel
Definition at line 11 of file GUIModelSubscriber.h.
GUIModelSubscriber::GUIModelSubscriber | ( | unsigned int | which | ) |
Create a GUIModel subscriber.
which | - bit set indicating which messages we want |
See GUIModelData for the list of possibilities
Definition at line 10 of file GUIModelSubscriber.cxx.
References om::GUIModel::Instance(), and om::GUIModel::Subscribe().
GUIModelSubscriber::~GUIModelSubscriber | ( | ) |
Definition at line 17 of file GUIModelSubscriber.cxx.
References om::GUIModel::Instance(), and om::GUIModel::Unsubscribe().
bool GUIModelSubscriber::GetLock | ( | ) |
Definition at line 24 of file GUIModelSubscriber.cxx.
References gsLock, MECModelEnuComparisons::i, and kSleep.
Referenced by om::CaptionBox::GUIModelDataIssue(), om::HistogramInfo::GUIModelDataIssue(), om::ButtonBank::GUIModelDataIssue(), om::HistogramBrowser::GUIModelDataIssue(), om::PlotViewer::GUIModelDataIssue(), and om::WatchListBox::GUIModelDataIssue().
|
pure virtual |
Receive notifications when the GUI model data has changed
m | - The new model data |
which | - Which element of the data has changed |
See GUIModel.h for the definitions of "which".
Note: To prevent collisions between threads, users should implement their "GUIModelDataIssue" methods following this pattern:
{ book aok = this->GetLock(); if (!aok) return;
...your code here...
this->ReleaseLock(); }
Implemented in om::WatchListBox, om::PlotViewer, om::HistogramBrowser, om::ButtonBank, om::ComparisonBox, om::CaptionBox, and om::HistogramInfo.
void GUIModelSubscriber::ReleaseLock | ( | ) |
Definition at line 41 of file GUIModelSubscriber.cxx.
References gsLock.
Referenced by om::CaptionBox::GUIModelDataIssue(), om::HistogramInfo::GUIModelDataIssue(), om::ButtonBank::GUIModelDataIssue(), om::HistogramBrowser::GUIModelDataIssue(), om::PlotViewer::GUIModelDataIssue(), and om::WatchListBox::GUIModelDataIssue().