Abstract class for parameters that may be watched by one or more interested classes. More...
#include <PlotMSWatchedParameters.h>
Public Member Functions | |
PlotMSWatchedParameters () | |
Non-Static //. | |
virtual | ~PlotMSWatchedParameters () |
Destructor. | |
void | addWatcher (PlotMSParametersWatcher *watcher) |
Adds/Removes the given watcher for this PlotMSParameters. | |
void | removeWatcher (PlotMSParametersWatcher *watcher) |
void | holdNotification (PlotMSParametersWatcher *updater=NULL) |
Holds update notifications for any registered watchers. | |
void | releaseNotification () |
Releases update notification; notifies all watchers of an update except for the one (if any) that called holdNotification. | |
virtual bool | operator== (const PlotMSWatchedParameters &other) const |
Equality operators. | |
virtual bool | operator!= (const PlotMSWatchedParameters &other) const |
virtual bool | equals (const PlotMSWatchedParameters &other, int updateFlags) const =0 |
ABSTRACT METHODS //. | |
Static Public Member Functions | |
static int | REGISTER_UPDATE_FLAG (const String &name) |
Registers an update flag with the given name (if it is not already registered) and returns its flag value. | |
static void | UNREGISTER_UPDATE_FLAG (const String &name) |
Unregisters the given update flag, if it is registered. | |
static void | UNREGISTER_UPDATE_FLAG (int flag) |
static int | UPDATE_FLAG (const String &name) |
Converts between an update flag's name and value, if valid. | |
static String | UPDATE_FLAG (int flag) |
static std::vector< int > | UPDATE_FLAGS () |
Returns all registered update flags. | |
static std::vector< String > | UPDATE_FLAG_NAMES () |
static int | ALL_UPDATE_FLAGS () |
Returns all registered update flags as one or-ed value. | |
static std::vector< int > | UPDATE_FLAGS (int value) |
Returns all registered update flags that were turned on in the given flags value. | |
static std::vector< String > | UPDATE_FLAG_NAMES (int value) |
Static Public Attributes | |
static const int | NO_UPDATES |
Static //. | |
Protected Member Functions | |
int | currentUpdateFlag () const |
Returns the current update flag. | |
void | updateFlag (int updateFlag, bool on=true) |
Provides access to children to indicate whether the given update flag should be turned on or off. | |
void | updateFlag (const String &updateFlagName, bool on=true) |
void | updateFlags (int updateFlags) |
Provides access to children to indicate which update flags are on. | |
Private Attributes | |
int | itsUpdateFlags_ |
Current update flags. | |
std::vector < PlotMSParametersWatcher * > | itsWatchers_ |
Watchers. | |
bool | isHolding_ |
Flag for whether notifications are currently being held or not. | |
PlotMSParametersWatcher * | itsUpdater_ |
Watcher that is currently holding notifications, or NULL for none. | |
Static Private Attributes | |
static std::vector< int > | FLAGS |
Static //. | |
static std::vector< String > | NAMES |
Registered flag names. |
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 casa::PlotMSWatchedParameters::~PlotMSWatchedParameters | ( | ) | [virtual] |
Destructor.
void casa::PlotMSWatchedParameters::addWatcher | ( | PlotMSParametersWatcher * | watcher | ) |
Adds/Removes the given watcher for this PlotMSParameters.
static int casa::PlotMSWatchedParameters::ALL_UPDATE_FLAGS | ( | ) | [static] |
Returns all registered update flags as one or-ed value.
Referenced by operator==().
int casa::PlotMSWatchedParameters::currentUpdateFlag | ( | ) | const [protected] |
Returns the current update flag.
virtual bool casa::PlotMSWatchedParameters::equals | ( | const PlotMSWatchedParameters & | other, | |
int | updateFlags | |||
) | const [pure virtual] |
ABSTRACT METHODS //.
Returns true if this PlotMSParameters equals the other, in the given update categories flag.
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.
virtual bool casa::PlotMSWatchedParameters::operator!= | ( | const PlotMSWatchedParameters & | other | ) | const [inline, virtual] |
Definition at line 143 of file PlotMSWatchedParameters.h.
References operator==().
virtual bool casa::PlotMSWatchedParameters::operator== | ( | const PlotMSWatchedParameters & | other | ) | const [inline, virtual] |
Equality operators.
Definition at line 141 of file PlotMSWatchedParameters.h.
References ALL_UPDATE_FLAGS(), and equals().
Referenced by operator!=().
static int casa::PlotMSWatchedParameters::REGISTER_UPDATE_FLAG | ( | const String & | name | ) | [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 void casa::PlotMSWatchedParameters::UNREGISTER_UPDATE_FLAG | ( | int | flag | ) | [static] |
static void casa::PlotMSWatchedParameters::UNREGISTER_UPDATE_FLAG | ( | const String & | name | ) | [static] |
Unregisters the given update flag, if it is registered.
static String casa::PlotMSWatchedParameters::UPDATE_FLAG | ( | int | flag | ) | [static] |
static int casa::PlotMSWatchedParameters::UPDATE_FLAG | ( | const String & | name | ) | [static] |
Converts between an update flag's name and value, if valid.
Referenced by casa::PlotMSPlotParameters::notifyWatchers().
static std::vector<String> casa::PlotMSWatchedParameters::UPDATE_FLAG_NAMES | ( | int | value | ) | [static] |
static std::vector<String> casa::PlotMSWatchedParameters::UPDATE_FLAG_NAMES | ( | ) | [static] |
static std::vector<int> casa::PlotMSWatchedParameters::UPDATE_FLAGS | ( | int | value | ) | [static] |
Returns all registered update flags that were turned on in the given flags value.
static std::vector<int> casa::PlotMSWatchedParameters::UPDATE_FLAGS | ( | ) | [static] |
Returns all registered update flags.
void casa::PlotMSWatchedParameters::updateFlag | ( | const String & | updateFlagName, | |
bool | on = true | |||
) | [protected] |
void casa::PlotMSWatchedParameters::updateFlag | ( | int | updateFlag, | |
bool | on = true | |||
) | [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.
void casa::PlotMSWatchedParameters::updateFlags | ( | int | updateFlags | ) | [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.
std::vector<int> casa::PlotMSWatchedParameters::FLAGS [static, private] |
bool casa::PlotMSWatchedParameters::isHolding_ [private] |
Flag for whether notifications are currently being held or not.
Definition at line 181 of file PlotMSWatchedParameters.h.
int casa::PlotMSWatchedParameters::itsUpdateFlags_ [private] |
Current update flags.
Definition at line 175 of file PlotMSWatchedParameters.h.
Watcher that is currently holding notifications, or NULL for none.
Definition at line 184 of file PlotMSWatchedParameters.h.
std::vector<PlotMSParametersWatcher*> casa::PlotMSWatchedParameters::itsWatchers_ [private] |
Watchers.
Definition at line 178 of file PlotMSWatchedParameters.h.
std::vector<String> casa::PlotMSWatchedParameters::NAMES [static, private] |
Registered flag names.
Definition at line 193 of file PlotMSWatchedParameters.h.
const int casa::PlotMSWatchedParameters::NO_UPDATES [static] |