Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Observable class, sending notification to a set of Observer objects. More...
#include <ilviews/base/observer.h>
Public Member Functions | |
IlvObservable () | |
Empty constructor. | |
virtual void | notify (IlAny arg=0) |
Notification method, to be called in methods that modify the state of the object whenever required. | |
Friends | |
class | IlvObserver |
Observable class, sending notification to a set of Observer objects.
Library: views
This class implements the Observable side of the Observer/Observable design pattern. The notify
member function takes an optional parameter. This parameter can be used by observers aware of the types of state changes that can occur on the observable to optimize the notification process. This parameter is often an enumerated type indicating the method of the observable that has called the notify
method. The class implements a lock mechanism preventing loops of notification. Frequently in a data structure, some objects are observing each other's state and want both to propagate changes and be notified of other's changes. This introduces the risk of infinite loops of notification. The IlvObservable
class implements a lock that is set whenever its notify
member function is called, so that no nested call can be done for a given object. Observable objects are reference counted, as the reference count is often needed in subclasses.
IlvObservable
, IlvSmartData
, IlvSmartPointer
. IlvObservable::IlvObservable | ( | ) |
Empty constructor.
Initializes an instance of IlvObservable
.
virtual void IlvObservable::notify | ( | IlAny | arg = 0 |
) | [virtual] |
Notification method, to be called in methods that modify the state of the object whenever required.
arg | Any type of information the observable may want to provide on its state change, that could be useful to observers. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.