casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Static Private Attributes
casa::PlotMSWatchedParameters Class Reference

Abstract class for parameters that may be watched by one or more interested classes. More...

#include <PlotMSWatchedParameters.h>

Inheritance diagram for casa::PlotMSWatchedParameters:
casa::PlotMSParameters casa::PlotMSPlotParameters

List of all members.

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 vector< int > UPDATE_FLAGS ()
 Returns all registered update flags.
static vector< StringUPDATE_FLAG_NAMES ()
static int ALL_UPDATE_FLAGS ()
 Returns all registered update flags as one or-ed value.
static vector< int > UPDATE_FLAGS (int value)
 Returns all registered update flags that were turned on in the given flags value.
static vector< StringUPDATE_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.
vector< PlotMSParametersWatcher * > itsWatchers_
 Watchers.
bool isHolding_
 Flag for whether notifications are currently being held or not.
PlotMSParametersWatcheritsUpdater_
 Watcher that is currently holding notifications, or NULL for none.

Static Private Attributes

static vector< int > FLAGS
 Static //.
static vector< StringNAMES
 Registered flag names.

Detailed Description

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 76 of file PlotMSWatchedParameters.h.


Constructor & Destructor Documentation

Non-Static //.

Constructor.

Destructor.


Member Function Documentation

Adds/Removes the given watcher for this PlotMSParameters.

Returns all registered update flags as one or-ed value.

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.

Implemented in casa::PlotMSPlotParameters, and casa::PlotMSParameters.

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 146 of file PlotMSWatchedParameters.h.

References casa::operator==().

virtual bool casa::PlotMSWatchedParameters::operator== ( const PlotMSWatchedParameters other) const [inline, virtual]

Equality operators.

Definition at line 144 of file PlotMSWatchedParameters.h.

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.

Releases update notification; notifies all watchers of an update except for the one (if any) that called holdNotification.

static void casa::PlotMSWatchedParameters::UNREGISTER_UPDATE_FLAG ( const String name) [static]

Unregisters the given update flag, if it is registered.

static void casa::PlotMSWatchedParameters::UNREGISTER_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 String casa::PlotMSWatchedParameters::UPDATE_FLAG ( int  flag) [static]
static vector<String> casa::PlotMSWatchedParameters::UPDATE_FLAG_NAMES ( int  value) [static]
static vector<int> casa::PlotMSWatchedParameters::UPDATE_FLAGS ( ) [static]

Returns all registered update flags.

static vector<int> casa::PlotMSWatchedParameters::UPDATE_FLAGS ( int  value) [static]

Returns all registered update flags that were turned on in the given flags value.

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::updateFlag ( const String updateFlagName,
bool  on = true 
) [protected]
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.


Member Data Documentation

vector<int> casa::PlotMSWatchedParameters::FLAGS [static, private]

Static //.

Registered flags.

Definition at line 193 of file PlotMSWatchedParameters.h.

Flag for whether notifications are currently being held or not.

Definition at line 184 of file PlotMSWatchedParameters.h.

Current update flags.

Definition at line 178 of file PlotMSWatchedParameters.h.

Watcher that is currently holding notifications, or NULL for none.

Definition at line 187 of file PlotMSWatchedParameters.h.

Watchers.

Definition at line 181 of file PlotMSWatchedParameters.h.

vector<String> casa::PlotMSWatchedParameters::NAMES [static, private]

Registered flag names.

Definition at line 196 of file PlotMSWatchedParameters.h.

Static //.

"Base", or no updates, flag.

Definition at line 81 of file PlotMSWatchedParameters.h.


The documentation for this class was generated from the following file: