ui::util::Observable Class Reference

Inheritance diagram for ui::util::Observable:

Inheritance graph
[legend]
Collaboration diagram for ui::util::Observable:

Collaboration graph
[legend]
List of all members.

Detailed Description

Item that can be observed by an Observer. Once this Item is changed, the Observer is notified that a change has occured, and can take appropiate action. This is to loosen coupling of classes, as an Observer knows nothing about it's observable and visa vice.


Public Member Functions

void addObserver (Observer *observer)
void removeObserver (Observer *observer)
void removeObservers ()
void notifyObserver ()
virtual ~Observable ()

Protected Member Functions

void setChanged ()
bool hasChanged () const
void clearChanged ()
 Observable ()


Constructor & Destructor Documentation

ui::util::Observable::~Observable  )  [virtual]
 

Destructor.

ui::util::Observable::Observable  )  [protected]
 

Default constructor.


Member Function Documentation

void ui::util::Observable::addObserver Observer observer  ) 
 

Add an Observer to this Observable.

Parameters:
observer the Observer to add.

void ui::util::Observable::removeObserver Observer observer  ) 
 

Remove an Observer from this Observable.

Parameters:
observer The Observer to remove.

void ui::util::Observable::removeObservers  ) 
 

Remove all Observers from this Observable.

void ui::util::Observable::notifyObserver  ) 
 

Notify the Observers of a change. The Observers are only called when the isChanged flag is set to true.

See also:
setChanged, hasChanged, clearChanged

void ui::util::Observable::setChanged  )  [protected]
 

Sets the isChanged flag to true. Next time the notifyObserver method is called, the Observers will be notified of the change.

bool ui::util::Observable::hasChanged  )  const [protected]
 

Returns the isChanged flag.

void ui::util::Observable::clearChanged  )  [protected]
 

Set the isChanged flag to false.


Generated on Mon Jun 20 19:42:06 2005 for UI by doxygen 1.3.1 using KingsTools