casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | Static Private Attributes | List of all members
casa::PlotMSWatchedParameters Class Referenceabstract

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

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...
 
PlotMSParametersWatcheritsUpdater_
 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...
 

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

Constructor & Destructor Documentation

casa::PlotMSWatchedParameters::PlotMSWatchedParameters ( )

Non-Static //.

Constructor.

virtual casa::PlotMSWatchedParameters::~PlotMSWatchedParameters ( )
virtual

Destructor.

Member Function Documentation

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.

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.

virtual bool casa::PlotMSWatchedParameters::operator!= ( const PlotMSWatchedParameters other) const
inlinevirtual

Definition at line 143 of file PlotMSWatchedParameters.h.

References operator==().

virtual bool casa::PlotMSWatchedParameters::operator== ( const PlotMSWatchedParameters other) const
inlinevirtual

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 casacore::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 ( const casacore::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 casacore::String name)
static

Converts between an update flag's name and value, if valid.

Referenced by casa::PlotMSPlotParameters::notifyWatchers().

static casacore::String casa::PlotMSWatchedParameters::UPDATE_FLAG ( int  flag)
static
static std::vector<casacore::String> casa::PlotMSWatchedParameters::UPDATE_FLAG_NAMES ( )
static
static std::vector<casacore::String> casa::PlotMSWatchedParameters::UPDATE_FLAG_NAMES ( int  value)
static
static std::vector<int> casa::PlotMSWatchedParameters::UPDATE_FLAGS ( )
static

Returns all registered update flags.

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.

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 casacore::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

std::vector<int> casa::PlotMSWatchedParameters::FLAGS
staticprivate

Static //.

Registered flags.

Definition at line 190 of file PlotMSWatchedParameters.h.

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.

PlotMSParametersWatcher* casa::PlotMSWatchedParameters::itsUpdater_
private

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<casacore::String> casa::PlotMSWatchedParameters::NAMES
staticprivate

Registered flag names.

Definition at line 193 of file PlotMSWatchedParameters.h.

const int casa::PlotMSWatchedParameters::NO_UPDATES
static

Static //.

"Base", or no updates, flag.

Definition at line 78 of file PlotMSWatchedParameters.h.


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