rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvObservable Class Reference

Observable class, sending notification to a set of Observer objects. More...

#include <ilviews/base/observer.h>

Inheritance diagram for IlvObservable:
IlvSmartData IlvActionHistory IlvCommandHistory

List of all members.

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

Detailed Description

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.

See also:
IlvObservable, IlvSmartData, IlvSmartPointer.

Constructor & Destructor Documentation

IlvObservable::IlvObservable (  ) 

Empty constructor.

Initializes an instance of IlvObservable.


Member Function Documentation

virtual void IlvObservable::notify ( IlAny  arg = 0  )  [virtual]

Notification method, to be called in methods that modify the state of the object whenever required.

Parameters:
arg Any type of information the observable may want to provide on its state change, that could be useful to observers.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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