casa
5.7.0-16
|
Abstract class for parameters that may be watched by one or more interested classes. More...
#include <PlotMSWatchedParameters.h>
Public Member Functions | |
PlotMSWatchedParameters () | |
Non-Static //. More... | |
virtual | ~PlotMSWatchedParameters () |
Destructor. More... | |
void | addWatcher (PlotMSParametersWatcher *watcher) |
Adds/Removes the given watcher for this PlotMSParameters. More... | |
void | removeWatcher (PlotMSParametersWatcher *watcher) |
void | holdNotification (PlotMSParametersWatcher *updater=NULL) |
Holds update notifications for any registered watchers. More... | |
void | releaseNotification () |
Releases update notification; notifies all watchers of an update except for the one (if any) that called holdNotification. More... | |
virtual bool | operator== (const PlotMSWatchedParameters &other) const |
Equality operators. More... | |
virtual bool | operator!= (const PlotMSWatchedParameters &other) const |
virtual bool | equals (const PlotMSWatchedParameters &other, int updateFlags) const =0 |
ABSTRACT METHODS //. More... | |
Static Public Member Functions | |
static int | REGISTER_UPDATE_FLAG (const casacore::String &name) |
Registers an update flag with the given name (if it is not already registered) and returns its flag value. More... | |
static void | UNREGISTER_UPDATE_FLAG (const casacore::String &name) |
Unregisters the given update flag, if it is registered. More... | |
static void | UNREGISTER_UPDATE_FLAG (int flag) |
static int | UPDATE_FLAG (const casacore::String &name) |
Converts between an update flag's name and value, if valid. More... | |
static casacore::String | UPDATE_FLAG (int flag) |
static std::vector< int > | UPDATE_FLAGS () |
Returns all registered update flags. More... | |
static std::vector < casacore::String > | UPDATE_FLAG_NAMES () |
static int | ALL_UPDATE_FLAGS () |
Returns all registered update flags as one or-ed value. More... | |
static std::vector< int > | UPDATE_FLAGS (int value) |
Returns all registered update flags that were turned on in the given flags value. More... | |
static std::vector < casacore::String > | UPDATE_FLAG_NAMES (int value) |
Static Public Attributes | |
static const int | NO_UPDATES |
Static //. More... | |
Protected Member Functions | |
int | currentUpdateFlag () const |
Returns the current update flag. More... | |
void | updateFlag (int updateFlag, bool on=true) |
Provides access to children to indicate whether the given update flag should be turned on or off. More... | |
void | updateFlag (const casacore::String &updateFlagName, bool on=true) |
void | updateFlags (int updateFlags) |
Provides access to children to indicate which update flags are on. More... | |
Private Attributes | |
int | itsUpdateFlags_ |
Current update flags. More... | |
std::vector < PlotMSParametersWatcher * > | itsWatchers_ |
Watchers. More... | |
bool | isHolding_ |
Flag for whether notifications are currently being held or not. More... | |
PlotMSParametersWatcher * | itsUpdater_ |
Watcher that is currently holding notifications, or NULL for none. More... | |
Static Private Attributes | |
static std::vector< int > | FLAGS |
Static //. More... | |
static std::vector < casacore::String > | NAMES |
Registered flag names. More... | |
Abstract class for parameters that may be watched by one or more interested classes.
Any subclass is assumed to have different properties in one or more of the update categories defined different update flag values which must be registered with the public static methods in PlotMSWatchedParameters. Using this system, any classes watching the parameters for changes can be notified which categories the changes occurred in.
Definition at line 73 of file PlotMSWatchedParameters.h.
casa::PlotMSWatchedParameters::PlotMSWatchedParameters | ( | ) |
Non-Static //.
Constructor.
|
virtual |
Destructor.
void casa::PlotMSWatchedParameters::addWatcher | ( | PlotMSParametersWatcher * | watcher | ) |
Adds/Removes the given watcher for this PlotMSParameters.
|
static |
Returns all registered update flags as one or-ed value.
Referenced by operator==().
|
protected |
Returns the current update flag.
|
pure virtual |
ABSTRACT METHODS //.
Returns true if this PlotMSParameters equals the other, in the given update categories flag.
Implemented in casa::PlotMSPlotParameters, and casa::PlotMSParameters.
Referenced by operator==().
void casa::PlotMSWatchedParameters::holdNotification | ( | PlotMSParametersWatcher * | updater = NULL | ) |
Holds update notifications for any registered watchers.
Notifications will not be sent out until releaseNotification() is called. If a non-NULL watcher is given, it will be excluded from notifications when releaseNotification() is called.
|
inlinevirtual |
Definition at line 143 of file PlotMSWatchedParameters.h.
References operator==().
|
inlinevirtual |
Equality operators.
Definition at line 141 of file PlotMSWatchedParameters.h.
References ALL_UPDATE_FLAGS(), and equals().
Referenced by operator!=().
|
static |
Registers an update flag with the given name (if it is not already registered) and returns its flag value.
void casa::PlotMSWatchedParameters::releaseNotification | ( | ) |
Releases update notification; notifies all watchers of an update except for the one (if any) that called holdNotification.
void casa::PlotMSWatchedParameters::removeWatcher | ( | PlotMSParametersWatcher * | watcher | ) |
|
static |
Unregisters the given update flag, if it is registered.
|
static |
|
static |
Converts between an update flag's name and value, if valid.
Referenced by casa::PlotMSPlotParameters::notifyWatchers().
|
static |
|
static |
|
static |
|
static |
Returns all registered update flags.
|
static |
Returns all registered update flags that were turned on in the given flags value.
|
protected |
Provides access to children to indicate whether the given update flag should be turned on or off.
This should be used by setter functions to classify the changes appropriately. If update notifications are NOT being held, any watchers will immediately be notified of the change.
|
protected |
|
protected |
Provides access to children to indicate which update flags are on.
The given value should be a bit-wise or of one or more UpdateFlag enum values.
|
staticprivate |
|
private |
Flag for whether notifications are currently being held or not.
Definition at line 181 of file PlotMSWatchedParameters.h.
|
private |
Current update flags.
Definition at line 175 of file PlotMSWatchedParameters.h.
|
private |
Watcher that is currently holding notifications, or NULL for none.
Definition at line 184 of file PlotMSWatchedParameters.h.
|
private |
Watchers.
Definition at line 178 of file PlotMSWatchedParameters.h.
|
staticprivate |
Registered flag names.
Definition at line 193 of file PlotMSWatchedParameters.h.
|
static |